When I open a new Doc object, I lose any way to access the previous document.
Once I have opened the new document, I can save and close the previous document, but I want access to the items in it.
Code:
BOOL CVSTADoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
POSITION myPos = GetDocTemplate()->GetFirstDocPosition();
CDocument *myDoc = GetDocTemplate()->GetNextDoc(myPos);
if (myDoc != this)
{
/* Need code for this */
}
return TRUE;
}
Once I have opened the new document, I can save and close the previous document, but I want access to the items in it.