BOOL CFracticeDoc::OnOpenDocument(LPCTSTR lpszPathName) { BOOL retc; if (IsSnapshot(lpszPathName)) // if path is a snapshot retc = ReadSnapshot(lpszPathName); else { // path is a project CMainFrame::CStatusMsg status(IDS_DOC_OPENING); retc = CDocument::OnOpenDocument(lpszPathName); // do base class open } // if open succeeded and first new document is unmodified if (retc && m_FirstNewDoc != NULL && !m_FirstNewDoc->IsModified()) m_FirstNewDoc->Close(); // close first new document return(retc); }
int Run(void* ptr) { unsigned char* snapshot; int length = ReadSnapshot(&snapshot); return RunSnapshot(snapshot, length); }