1. MainFrame 포인터 얻기
CMainFrame *frame = (CMainFrame*)AfxGetMainWnd();
2. Doc 클래스 포인터 얻기
CxxxDoc *pDoc = (CxxxDoc*)(frame->GetActivedocument());
3. View 클래스 포인터 얻기
CxxxView* pView = (CxxxView*)((CMainFrame*)(AfxGetApp()->m_pMainWnd))->GetActiveView();
[SDI 형태]
1. MainFrame 얻기
- CMainFrame *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();
1. MainFrame 얻기
- CMainFrame *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 포인터 얻기
- CCainFrame *pFrame = (CMainFrame)AfxGetMainWnd();
CChildFrame *pChild = (CChildFrame *)pFrame->GetActiveFrame();
CMdiTestView *pView = (CMdiTestDoc *)pChild->GetActiveView();
- CMdiTestView *pView = (((CMainFrame *)AfxGetMainWnd())->GetActiveFrame())->GetActiveView();
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 포인터 얻기
- CCainFrame *pFrame = (CMainFrame)AfxGetMainWnd();
CChildFrame *pChild = (CChildFrame *)pFrame->GetActiveFrame();
CMdiTestView *pView = (CMdiTestDoc *)pChild->GetActiveView();
- CMdiTestView *pView = (((CMainFrame *)AfxGetMainWnd())->GetActiveFrame())->GetActiveView();
'Language > C C++ MFC' 카테고리의 다른 글
PreTranslateMessage() (0) | 2007.07.12 |
---|---|
MFC에서 파일의 용량 가져오기 CreateFile(), GetFileSize() (0) | 2007.07.12 |
문자열 검색 (0) | 2007.05.22 |
MFC 키 포인트 (0) | 2007.05.22 |
MFC CRectTracker 를 정적라이브러리 링크시 커서 안보입니다 (0) | 2007.05.18 |