Location | Tag | Media  ||  A | P


//App 클래스
CMainFrame *pMain=(CMainFrame *)AfxGetMainWnd(); //App -> MainFrm
CClassView *pView=(CClassView *)pMain->GetActiveView(); //App -> MainFrm -> View
CClassDoc *pDoc=(CClassDoc *)pMain->GetActiveDocument(); //App -> MainFrm -> Doc
 
//뷰클래스
void CClassView::OnMenuView()
CClassApp *pApp=(CClassApp *)AfxGetApp();   //View -> App
CMainFrame *pMain=(CMainFrame *)AfxGetMainWnd();  //View -> MainFrm
CClassDoc *pDoc=(CClassDoc *)pMain->GetActiveDocument();//View -> MainFrm -> Doc
CClassDoc *pDoc=(CClassDoc *)GetDocument(); //View -> Doc

//MainFrame 클래스
CClassView *pView=(CClassView *)GetActiveView();  //MainFrm -> View
CClassDoc *pDoc=(CClassDoc *)GetActiveDocument();  //MainFrm -> Doc
CClassApp *pApp=(CClassApp *)AfxGetApp(); //MainFrm -> App

//Doc 클래스
CClassApp *pApp=(CClassApp *)AfxGetApp(); //Doc -> App
CMainFrame *pMain=(CMainFrame *)AfxGetMainWnd(); //Doc -> MainFrm
CClassView *pView=(CClassView *)pMain->GetActiveView();// Doc -> MainFrm -> View
CClassView *pView=(CClassView *)m_viewList.GetHead(); // Doc -> View


//커스텀클래스 포인터

((커스텀클래스명 *)AfxGetMainWnd())->호출펑션();

Posted by Bestend
: