Click to See Complete Forum and Search --> : Serialize a collection


May 9th, 1999, 03:31 PM
How can I serialize the collection CTypedPtrMap<CMapStringToOb, CString, CMyOb*>
I have written the serialize code in MyObject,used IMPLEMENT_SERIAL, etc, and then put m_MapStringToOb.Serialize(ar) in the doc serialize section. When I try to save, it gives me an access violation, saying that I have no Runtime Class (as this needs to be written into the archive before any data is stored). Can anybody help.

cniquille
June 2nd, 1999, 05:02 AM
you can not serialize a Class who is not inherited from CObject.
You must create a special class inherited from CObject then put all information of your CTypedPtrMap class in this class then serialize this class.
Beware with pointer, if i'm not wrong you can not seriqlize a pointer

Christian Niquille