Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing previous CDocument object after opening a new one.

Status
Not open for further replies.

countdrak

Programmer
Jun 20, 2003
358
US
When I open a new Doc object, I lose any way to access the previous document.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top