回覆列表
  • 1 # kepot26996

    透過App類來獲取.標頭檔案定義:CmyView *GetmyView();實現:CmyView *CmyApp::GetmyView(){ if(m_pDocManager) { POSITION pos1 = m_pDocManager->GetFirstDocTemplatePosition(); while (pos1) { CDocTemplate *pDocTemplate = m_pDocManager->GetNextDocTemplate(pos1); if(pDocTemplate) { POSITION pos2 = pDocTemplate->GetFirstDocPosition(); while (pos2) { CDocument *pDoc = pDocTemplate->GetNextDoc(pos2); if(pDoc) { POSITION pos3 = pDoc->GetFirstViewPosition(); while (pos3) { CView *pView = pDoc->GetNextView(pos3); if(pView) { if(pView->IsKindOf(RUNTIME_CLASS(CmyView))) return (CmyView*)pView; } } } } } } } return NULL;}

  • 中秋節和大豐收的關聯?
  • 你在遊戲裡遇到最恐怖的事是什麼?