摘要: 获得MFC窗口其它类指针的方法来源:中国自学编程网 发布日期:2008-09-26 获得CWinApp: -在CMainFrame,CChildFrame,CDocument,CView中直接调用AfxGetApp()或用theApp -在其它类中只能用AfxGetApp() 获得CMainFrame: -在CMinApp中用AfxGetMainWnd()或者m_pMainWnd -在CChildFrame中可用GetParentFrame() -在其它类中用AfxGetMainWnd() 获得CChildFrame: -在CView中用GetParentFrame() -在CMainFram 阅读全文
posted @ 2011-03-21 22:48 安义 阅读(728) 评论(0) 推荐(0) 编辑
摘要: CChildFrame *pChild = (CChildFrame *) ((CMainFrame*)theApp.GetMainWnd())->GetActiveFrame(); CMyDoc* pDoc = NULL; pDoc = (CMyDoc*)pChild->GetActiveDocument(); CView* pView; if(pDoc!=NULL) { POSITION pos=pDoc->GetFirstViewPosition(); while(pos!=NULL){ pView=pDoc->GetNextView(pos); if(pView 阅读全文
posted @ 2011-03-21 22:34 安义 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 2010-01-11 17:23如何在MFC单文档中创建多视图基本步骤如下:1.首先创建一个MFC单文档应用程序。2.添加4个MFC类TopLView、BottomLView、TopRView、BottomRView,基类为CView。3.添加一个MFC类CControlForm,基类为CFormView,对话框ID默认。4.创建一个切分类,如MySplitter,基类为CSplitterWnd(默认基类选项中无此类,自己添加即可)。5.在框架类Cmainframe的头文件中,添加2个MySplitter的变量(因为下面要进行两次切分操作)。6.重写框架类Cmainframe的OnCreate 阅读全文
posted @ 2011-03-21 22:10 安义 阅读(3021) 评论(0) 推荐(0) 编辑