Professional Documents
Culture Documents
Cpopapp Papp (Cpopapp ) (::afxgetapp ) //cast Cwinapp : Any Doc or View To Get A Pointer To The App That Owns Them
Cpopapp Papp (Cpopapp ) (::afxgetapp ) //cast Cwinapp : Any Doc or View To Get A Pointer To The App That Owns Them
way for a doc&ment to 'now which of its views( if any( is the active foc&s window of the &ser interface
CPopDoc::getActiveView()
You can access this class using: From this class: CWin App CMain Frame CChildFrame CDocument CView
CWinApp
AfxGet MainW nd() or m_pMa inWnd AfxG etApp () or theAp p AfxG etApp () or theAp p AfxG etApp () or theAp p AfxG etApp () or theAp p AfxG etApp ()
AfxGetMainWnd()>MDIGetActive()
AfxGetMainWnd()->GetActiveView()>GetDocument()
AfxGetMainWnd()->GetActiveView()
CMainFrame
MDIGetActive() or GetActiveFrame()
>GetDocument()
CChildFrame
Get"are ntFrame ()
GetActiveView()->GetDocument()
GetActiveView()
CDocument
AfxGetMainWnd()>MDIGetActive()
CView
Get"arentFrame()
GetDocument()
AfxGetMainWnd()>MDIGetActive() or AfxGetMainWnd()>GetActiveFrame()
DI! AfxGetMainWnd()->GetActiveView()-
>GetActiveView()
Note: $o acce&& on*+ the current view, the document c*a&& can ca** AfxGetMainWnd()->GetActiveView() from a DI app*ication or AfxGetMainWnd()->MDIGetActive()->GetActiveView() from a MDI app*ication-