App 클래스에서
CMainFrame *pMain=(CMainFrame *)AfxGetMainWnd(); //App -> MainFrm
CClassView *pView=(CClassView *)pMain->GetActiveView(); //App -> MainFrm -> View
CClassDoc *pDoc=(CClassDoc *)pMain->GetActiveDocument(); //App -> MainFrm -> Doc
View 클래스에서
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
-끝-
'나머지 > IT개발.잡다한것.' 카테고리의 다른 글
닷넷 .net 프레임워크4 다운로드 (0) | 2012.10.29 |
---|---|
[MFC, C++, C, visual] error LNK2005 already defined in, MFC에서 전역변수사용하기. (1) | 2012.10.25 |
[MFC, C++] error C2011: "struct' type redefinition에러를 고치다... (0) | 2012.10.24 |
[MFC]error C2065: 'm_hWnd' : undeclared identifier 해결 ㅠ_ㅠ (1) | 2012.10.22 |
"stdafx.cpp" "stdafx.h" precompiled header (0) | 2012.10.22 |