hi, everybody I'm using CArchive constructed on CSocketFile and i'm trying to serialize CMsg objects like this : (note : ar is my archive and msg my message to serialize) ar.WriteClass(msg.GetRuntimeClass()); //it works fine ar.WriteObject(&msg); //works fine and at the other side of the network i have : CRuntimeClass * pClass = ar.ReadClass(); //this throw me an error CArchiveExceptionError::badIndex Any ideas about this ?
G
goupil
@goupil
Posts
-
ReadClass & WriteClass -
template & IMPLEMENT_SERIAL ??Many Thanks for your respond, it will avoid me long hours of research :))
-
template & IMPLEMENT_SERIAL ??hi, i have a problem with the macro IMPLEMENT_SERIAL. Because my class TempClass is Template and when i try to insert the macro into the .h file, the compiler says i have to write the arguments of TempClass. Does someone have an idea ? Here's the code : ******************************************* template class TempClass : public Msg { DECLARE_SERIAL(TempClass ) TempClass(); ~TempClass(); //here the rest of class declaration... virtual void Serialize (CArchive& ar); }; IMPLEMENT_SERIAL(TempClass ,Msg,1) //it crashes here template TempClass ::TempClass () { ... } ...