Free Web Site - Free Web Space and Site Hosting - Web Hosting - Internet Store and Ecommerce Solution Provider - High Speed Internet
Search the Web

Serialize Frame

VC++ (MFC) Tips :     Document Class and Document Object


class CPerson : public Cobject
{
public:

DECLARE_SERIAL( CPerson )
// empty constructor is necessary
CPerson(){};

CString m_name;
WORD m_number;

void Serialize( CArchive& archive );
// rest of class declaration

};

 

IMPLEMENT_SERIAL(CMyLine, CObject,1)
void CPerson::Serialize( CArchive& archive )
{

// call base class function first
// base class is CObject in this case
CObject::Serialize( archive );
// now do the stuff for our specific class
if( archive.IsStoring() )
archive << m_name << m_number;
else
archive >> m_name >> m_number;

}


Copyright (c) 1999 - 2001, robert han, all rigths are reserved.