If anyone has any idea, I'd be grateful. Basically, I'm trying to make some class serializable with CArchive, but it isn't working out too well, because I can't get the macro IMPLEMENT_SERIAL_NEW to work.
The problem lies in that the class CIndex is nested inside CRegistry (and also declared private). Typing CRegistry::CIndex and passing it to the macro causes major compile errors due to the way it's structured.
So I've tried a typedef CRegistry::CIndex CIndex; which doesn't work because it's private! Neither can I actually make a friend or anything because it's in global scope level.
The current solutions seems to be to re-define IMPLEMENT_SERIAL_NEW and all its depending macros to take an extra arg - the full class path and class name or make CIndex public or moving it outside CRegistry.
Are there any other viable solutions to a problem like this?
Oh yes, I tried doing it in the header, inside the encapsuling class, but then it would complain with all sorts of errors such as cannot overload static and non-static functions of the same name or something? And also cannot overload a function from an interface it isn't derived from or some such.