Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can a frame window gain access to the document object in a doc/view architecture program?


I have this sdi app that have a toolbar, status bar and tab control.

1. How can my frame window access the document object.I need to update the document with info from combobox embedded in toolbar.Also I need to update the status bar with informtion from the document.
Posted

1 solution

The answer is really easy to find on the web ...

C++
// SDI document implementation file
   CMyDoc * CMyDoc::GetDoc()
   {
      CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);
      return (CMyDoc *) pFrame->GetActiveDocument();
   }


http://support.microsoft.com/kb/108587[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900