您的位置:首页 > 大数据 > 人工智能

各种Doc类View类MainFram类的联系方法(文档,视图,框架之间的相互引用方法)

2007-04-24 11:06 369 查看

mainframe->view, mainfram->ew:

GetActiveView() GetActiveDocument() GetDocument()

或 CxxxxDoc *pDoc;
pDoc=(CxxxxDoc*)GetActiveDocument();

或 CxxxxxView* pView=(CxxxxxView*)m_wndSplitter1.GetPane(0,0);这是指分割窗口时引用某个窗口,想得到那个子窗口的视图,其中参数是视图索引

view->Mainframe vie->Document

CMainFrame* pMainfrm;
pMainfrm=(CMainFrame*)AfxGetMainWnd();

或CMainFrame* pMainfrm;
pMainfrm=(CMainFrame*)GetParentFrame();

或ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CxxxxxDoc)));
return (CxxxxxxDoc*)m_pDocument;这个大家都见过,就是GetDocument的定义

Documtnent->View Document->Mainframe

都差不多.

注:-------------得到的指针后最好ASSERT_VALID(指针)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐