在C++ MFC中Single document和Dialog based有什么具体的区别?
2014-04-29 17:28
459 查看
csdn 回答
在我个人看来有两个区别
1,SDI比dialog based有更丰富的默认窗体,比如,默认的菜单,
2,SDI有document-view的代码结构,而DIALOG based没有这个D-V结构
总结一下就是,DIALOG BASED趋向于做任务非常单一的小程序,所有的任务可以在一个窗体完成的
而SDI会复杂一点
但是界限不明显,因为DIALOG BASED也可以做成非常复杂的窗体
只是SDI默认就多了一些支持
stackoverflow回答:
http://stackoverflow.com/questions/660843/choosing-between-a-dialog-based-vs-sdi-projects
If you select an SDI project you get a whole Model-View-Controller framework included. You get a document class (inheriting from CDocument) which ideally should hold all of the data, and a view class (inheriting from CView) to do with the display. You get
given a hosting frame with a menu already attached, and there are functions you can override to save and load to file.
If you have a dialog based application, then you get one dialog. That's it. Of course, this dialog can spawn off others, but the application essentially consists of a dialog.
If you're developing a small application that just does one task, a dialog application is appropriate, because you don't need the overhead.
在我个人看来有两个区别
1,SDI比dialog based有更丰富的默认窗体,比如,默认的菜单,
2,SDI有document-view的代码结构,而DIALOG based没有这个D-V结构
总结一下就是,DIALOG BASED趋向于做任务非常单一的小程序,所有的任务可以在一个窗体完成的
而SDI会复杂一点
但是界限不明显,因为DIALOG BASED也可以做成非常复杂的窗体
只是SDI默认就多了一些支持
stackoverflow回答:
http://stackoverflow.com/questions/660843/choosing-between-a-dialog-based-vs-sdi-projects
If you select an SDI project you get a whole Model-View-Controller framework included. You get a document class (inheriting from CDocument) which ideally should hold all of the data, and a view class (inheriting from CView) to do with the display. You get
given a hosting frame with a menu already attached, and there are functions you can override to save and load to file.
If you have a dialog based application, then you get one dialog. That's it. Of course, this dialog can spawn off others, but the application essentially consists of a dialog.
If you're developing a small application that just does one task, a dialog application is appropriate, because you don't need the overhead.
相关文章推荐
- 【转载】实用VC++6.0插件
- 最近我在学习c++,为android项目做准备。
- C语言宏定义##连接符和#符的使用
- 安装clang 3.2 遇到的/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found `GLIBCXX_3.4.11 not 解决办法
- 【转载】C语言 构建参数个数不固定函数
- LeetCode——Sort List
- [C++]不用if比较两个数大小
- 《C语言入门经典第四版 》笔记2
- C++函数重载实现原理浅析
- C++函数重载实现原理浅析
- c++ 异常处理
- VC++中的复制粘贴实现
- C++ Daily 《4》----一个简单的 int to string 的方法
- C++ Daily 《4》----一个简单的 int to string 的方法
- 用UMDH检查C++程序内存泄露
- C++语法
- 读书笔记:C++ Primer系列(12)—— 类型转换
- C++的虚函数 Virtual Function
- 自定义C++异常处理
- gl.h报错