2013年11月8日

MFC框架类、文档类、视图类相互访问的方法(转)

摘要: 1、获取应用程序指针 CMyApp* pApp=(CMyApp*)AfxGetApp();2、获取主框架指针 CWinApp 中的公有成员变量 m_pMainWnd 就是主框架的指针 CMainFrame* pMainFrame = (CMainFrame*)(AfxGetApp()->m_pMainWnd); 或者 CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();3、获取菜单指针 CMenu* pMenu = AfxGetMainWnd()->GetMenu();4、获取工具栏、状态栏指针 主框架中可以直接使用m_wnd 阅读全文

posted @ 2013-11-08 20:53 cclow 阅读(289) 评论(0) 推荐(0)

导航