Game Development Reference
In-Depth Information
Figure B.10 Saving the document.
The default implementation of a document includes a Serialize function.
This is called whenever the user chooses Save or Open from the default
menu. The function is passed a CArchive reference that takes care of
much of the complexity of saving and loading documents. Most MFC
classes have the operators << and >> overridden so that to save a class
you simply need to use << to save and >> to load. When using a CArchive
class the function IsStoring evaluates to TRUE if the user has chosen to
Save and FALSE if the user has chosen to Load .
void CMFCSingleDocDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar<<rect;
}
else
{
ar>>rect;
}
}
Search Nedrilad ::




Custom Search