This method is called by the framework as part of the File Open command. The default implementation of this method opens the specified file, calls the DeleteContents method to ensure that the document is empty, calls CObject::Serialize to read the file’s contents, and then marks the document as clean.
Override this method if you want to use something other than the archive mechanism or the file mechanism. For example, you might write an application where documents represent records in a database rather than separate files.
Header file: | Afxwin.h |
Platforms: | H/PC 2.0, Palm-size PC, H/PC Pro |
Windows CE versions: | 1.0 and later |
Complete documentation: | Visual C++ documentation |
virtual BOOL OnOpenDocument( LPCTSTR lpszPathName );
CDocument::DeleteContents, CDocument::OnCloseDocument, CDocument::OnNewDocument, CDocument::OnSaveDocument, CDocument::ReportSaveLoadException, CObject::Serialize