The chief structural differences between MDI and SDI applications built with MFC are as follows:
- MDI applications derive their top-level frame window classes from CMDI-FrameWnd rather than CFrameWnd.
- MDI applications use classes based on CMDIChildWnd to represent the child frame windows that frame views of their documents.
- MDI applications use CMultiDocTemplate rather than CSingleDocTemplate to create document templates. The frame window class referenced in CMultiDocTemplate's constructor is the child frame window class rather than the top-level frame window class.
- MDI applications have at least two menu resources, as opposed to SDI's one. One is displayed when no documents are open; the other is displayed when at least one document is open.
本文详细对比了使用MFC构建的多文档界面(MDI)应用与单文档界面(SDI)应用的主要结构差异。MDI应用使用了CMDIFrameWnd作为顶级窗口基类,并利用CMDIChildWnd类来表示文档视图的子窗口;此外,还介绍了MDI应用如何通过CMultiDocTemplate创建文档模板。MDI应用通常具备至少两个菜单资源,以区分在文档打开与未打开状态下的不同显示需求。

被折叠的 条评论
为什么被折叠?



