
i
i
i
i
i
i
i
i
E. An MFC Template Program 575
CFwDoc::CFwDoc(){}
CFwDoc::˜CFwDoc(){}
BOOL CFwDoc::OnNewDocument(){ // called in response to "New" on File menu
if (!CDocument::OnNewDocument())return FALSE;
..// put any code here to be executed when new document is created
return TRUE;
}
void CFwDoc::Serialize(CArchive& ar){ // This function is used to read
if (ar.IsStoring()){ .. } // and write documents to/from disk.
else { ... }
}
////////////// other message handers appear here in the code /////////////////
// this function matches the MESSAGE_MAP
void CFwDoc::OnFileCommand1(){
..// put code to implement the command here
}
Listing E.4. (continued).
class CFwView