Click to See Complete Forum and Search --> : Serializing my class, HOW?


Alfred
May 18th, 1999, 02:38 PM
Is it possible for me to save a object of this class?

class memory {
public:
memory();
int m_Mem[MAXMEM];
CString Noun[MAXWORDS];
CString Adjective[MAXWORDS];
CString Verb[MAXWORDS];
CString Nothing[MAXWORDS];
void CheckWord(CString word);
void SortIn(CString word, int type);

private:
CExtraDlg ExtraDlg;
int NounPosition;
int AdjectivePosition;
int VerbPosition;
int NothingPosition;
};

It should be saved in this way:

CFile f;
f.Open("backup.iq",
CFile::modeCreate | CFile::modeWrite);

memory ar(&f, CArchive::store);

ar << brain;


a

May 21st, 1999, 09:47 AM
derive yur memory class from CObject

Add serialize handler function to you memory class.
In your ProgDoc::Serialize call you memory instance .serialze