태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.


댓글 하나가 운영자에겐 커다란 힘이 됩니다!

CMainFrame* pFrame = (CMainFrame*)AfxGetApp()->GetMainWnd();


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();
 

 

[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. Vense

    | 2009/09/26 11:17 | PERMALINK | EDIT | REPLY |

    Doc 포인터 얻어오는거 정말 필요했던 자료였는데,
    정말 감사합니다. (__)

  2. Joel

    | 2009/12/22 10:59 | PERMALINK | EDIT | REPLY |

    감사합니다... 잘 봤습니다...

  3. 허파

    | 2010/02/26 11:06 | PERMALINK | EDIT | REPLY |

    MFC.. 미궁이네요. 휴..
    좋은 자료 감사합니다.

  4. 김동욱

    | 2010/04/08 13:15 | PERMALINK | EDIT | REPLY |

    MFC ㅜㅜ 너무 우려워요.ㅜ

    감사합니다.

Write your message and submit
« PREV : 1 : ... 110 : 111 : 112 : 113 : 114 : 115 : 116 : 117 : 118 : ... 436 : NEXT »