Serialize and DeSerialize of CObArray
Need help in the Serializing and DeSerializing of an CObArray.
I know to Serialize I just do this:
so how to I take out the CObArray and assign it to another CObArray object test2List?
thanks in advance.
You need to be more precise in what you are trying to say/do.
From posted code I would say CObArray is a user defined class. The the CObArray class has a method called Serialize() that takes a single argument. You declare testlist as a CObArray object. Then you pass ar, whatever that is, to the Serialize() method of that object.
Now to the crux of the problem: Are you trying to "copy" one CObArray object to another (a process accomplished by an overloaded assignment operator, and/or a copy constructor) or do you wish to transfer data in a member variable of one object into a member variable, method of another object?
CObArray is an array of Objects.
Do you mean that CObArray is an array of objects like
objectType * CObArray = new objectType[numberOFObjects];
and the line
is gibberish. Or do you mean something like a class that has an array of objects in it. Like this:
in which case the line:
CObArray is something MS wrote, Kinda like CString.It works like so
Then you have a whole bunch of methods to maniulate this array ex
It stored a pointer to the object and the size is dynamicly allocated.
It works really well
Ermm let me be more precise.
I declared a CObArray Object called tempList.
Than lets say I added stuff to it.
So the should be like this:
void CModule1Doc::Serialize(CArchive& ar)
// TODO: add storing code here
// Serialize tempList
// TODO: add loading code here
Now the problem I have is how to DeSerialize my tempList out.