您的位置:首页 > 编程语言 > C语言/C++

在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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: