728x90
출처 : http://blog.paran.com/jkbae/17823780
SDI 형태
1. MainFrame 얻기
: CMainFram *pFrame = (CMainFrame*)AfxGetMainWnd();
2. App포인터 얻기
: CTestApp *pApp = (CTestApp*)AfxGetApp();
3. Document 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CTestDoc *pDoc = (CTestDoc *)pFrame->GetActiveDocument();
: CTestDoc *pDoc = ((CMainFrame*)AfxGetMainWnd())->GetActiveDocument();
4. View 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CTestView *pView = (CTestView*)pFrame->GetActiveView();
: CTestView *pView = ((CMainFrame*)AfxGetMainWnd())->GetActiveView();
MDI 형태
1. ChildFrame 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CChildFrame *pChild = (CChildFrame*)pFrame->GetActiveFrame();
: CChildFrame *pChild = ((CMainFrame*)AfxGetMainWnd())->GetActiveFrame();
2. Document 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CChildFrame *pChild = (CChildFrame*)pFrame->GetActiveFrame();
CMdiTestDoc *pDoc = (CMdiTestDoc*)pChild->GetActiveDocument();
: CMdiTestDoc *pDoc = (((CMainFrame*)AfxGetMainWnd())->GetActiveFrame())->GetActiveDocument();
3. View 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CChildFrame *pChild = (CChildFrame*)pFrame->GetActiveFrame();
CMdiTestView *pView = (CMdiTestDoc*)pChild->GetActiveView();
: CMdiTestView *pView = (((CMainFrame*)AfxGetMainWnd())->GetActiveFrame())->GetActiveView();
SDI 형태
1. MainFrame 얻기
: CMainFram *pFrame = (CMainFrame*)AfxGetMainWnd();
2. App포인터 얻기
: CTestApp *pApp = (CTestApp*)AfxGetApp();
3. Document 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CTestDoc *pDoc = (CTestDoc *)pFrame->GetActiveDocument();
: CTestDoc *pDoc = ((CMainFrame*)AfxGetMainWnd())->GetActiveDocument();
4. View 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CTestView *pView = (CTestView*)pFrame->GetActiveView();
: CTestView *pView = ((CMainFrame*)AfxGetMainWnd())->GetActiveView();
MDI 형태
1. ChildFrame 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CChildFrame *pChild = (CChildFrame*)pFrame->GetActiveFrame();
: CChildFrame *pChild = ((CMainFrame*)AfxGetMainWnd())->GetActiveFrame();
2. Document 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CChildFrame *pChild = (CChildFrame*)pFrame->GetActiveFrame();
CMdiTestDoc *pDoc = (CMdiTestDoc*)pChild->GetActiveDocument();
: CMdiTestDoc *pDoc = (((CMainFrame*)AfxGetMainWnd())->GetActiveFrame())->GetActiveDocument();
3. View 포인터 얻기
: CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CChildFrame *pChild = (CChildFrame*)pFrame->GetActiveFrame();
CMdiTestView *pView = (CMdiTestDoc*)pChild->GetActiveView();
: CMdiTestView *pView = (((CMainFrame*)AfxGetMainWnd())->GetActiveFrame())->GetActiveView();
728x90
'Programming > VC++' 카테고리의 다른 글
유니코드로 개발하기 (0) | 2009.06.10 |
---|---|
C++에서 unit Test를 .... CppUnit (0) | 2009.05.24 |
[VS] Bitstream Vera Sans Mono 글꼴을 Visual Studio 2003에서 사용하기. (0) | 2007.08.13 |
[MFC] MFC 코딩 모음 (0) | 2007.03.09 |
[MFC] 다이얼로그에서 단축키 써보자 (0) | 2007.02.17 |
댓글