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 () { ... } ...
-
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 () { ... } ...
Sorry - you can't use MFC runtime type information with templates. IMPLEMENT_SERIAL/DYNCREATE/DYNAMIC will not work - that's because MFC creates some global variables named after your class name. With templates it simply doesn't work. Tomasz Sowinski -- http://www.shooltz.com
-
Sorry - you can't use MFC runtime type information with templates. IMPLEMENT_SERIAL/DYNCREATE/DYNAMIC will not work - that's because MFC creates some global variables named after your class name. With templates it simply doesn't work. Tomasz Sowinski -- http://www.shooltz.com