If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Serialize CMap

Trying to save and load a CMap. I thought I could just call the SerializeElements. But everybody seams to overload the SerializeElements why is that necsesary? I have not seen one single example of a call to the function.
SerializeElements takes the size of the CMap as input argument. But how do I know the size of the CMap when I load a CMap from a file?

OK,
Now I have put a override function for SerializeElements in the Document implementation. SerializeElements function is called like above in the Serialize function in the Document. But when I debug the code I never end up in the override function. Have I placed the override function in the wrong file maybee?

I think I should derive a class from CMap and implement the override function there. In my project I have four Maps storing different types of objects. So now I have to derive four classes from CMap or?

Now it almost work when I override the SerializeElements in the Document. I have tried to put it in CUser but I got a lot of linking errors. The problem now is that when a CUser is restored by calling its Serialize() function from the SerializeElements() function I want to a add this restored CUser element to the Map. But the compiler complains that the Map is undefined though it is owned by the Document.
Also I dont understand how the next position in the Map can be reached just by incrementing a CUser pointer.
Here is the code from the Document,