框架窗口如何在doc / view架构程序中获得对文档对象的访问权限? [英] How can a frame window gain access to the document object in a doc/view architecture program?
本文介绍了框架窗口如何在doc / view架构程序中获得对文档对象的访问权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
框架窗口如何在doc / view架构程序中访问文档对象?
我有这个sdi具有工具栏,状态栏和标签控件的应用程序。
1.我的框架窗口如何访问文档对象。我需要使用组合框中的信息更新文档嵌入在工具栏中。我还需要通过文档中的informtion更新状态栏。
解决方案
答案很容易在网上找到...
// SDI文件实现文件
CMyDoc * CMyDoc :: GetDoc()
{
CFrameWnd * pFrame =(CFrameWnd *)(AfxGetApp() - > m_pMainWnd);
return (CMyDoc *)pFrame-> GetActiveDocument();
}
How can a frame window gain access to the document object in a doc/view architecture program?
I have this sdi app that have a toolbar, status bar and tab control.
1. How can my frame window access the document object.I need to update the document with info from combobox embedded in toolbar.Also I need to update the status bar with informtion from the document.
解决方案
The answer is really easy to find on the web ...
// SDI document implementation file CMyDoc * CMyDoc::GetDoc() { CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd); return (CMyDoc *) pFrame->GetActiveDocument(); }
这篇关于框架窗口如何在doc / view架构程序中获得对文档对象的访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文