본문스크랩 주요 클래스 포인터 얻기


SDI 형태

  1. MainFrame 얻기

      – CMainFrame* pFrm = (CMainFrame *)AfxGetMainWnd();

  2. APP 얻기

      – CExamApp* pApp = (CExamApp *)AfxGetApp();

  3. Document 얻기

      – CMainFrame* pFrm = (CMainFrame *)AfxGetMainWnd();

      C00Doc* pDoc = (C00Doc *)pFrm->GetActiveDocument();

  4. View 얻기

      – CMainFrame* pFrm = (CMainFrame *)AfxGetMainWnd();

     C00View* pView = (C00View *)pFrm->GetActiveView();

 

MDI 형태

  1. ChildFrame 얻기

      – CMainFrame* pFrm = (CMainFrame *)AfxGetMainWnd();

     CChildFrame* pCHild = (CChildFrame *)pFrm->GetActiveFrame();

  2. Document 얻기

      – CMainFrame* pFrm = (CMainFrame *)AfxGetMainWnd();

     CCHildFrame* pChild = (CChildFrame *)pFrm->GetActiveFrame();

     C00Doc* pDoc = (C00Doc *)pChild->GetActiveDocument();

  3. View 얻기

      – CMainFrame* pFrm = (CMainFrame *)AfxGetMainWnd();

     CChildFrame* pChild = (CChildFrame *)pFrm->GetActiveFrame();

     C00View* pView = (C00View *)pChild->GetActiveView();

 


답글 남기기

이메일 주소는 공개되지 않습니다.