1.MFC获取主窗口指针的方法: CMainFrame* pMain=(CMainFrame*)AfxGetMainWnd(); CJB8View *pView = (CJB8View *)pMain->GetActiveView();