Choosing Between Dialog Based SDI Projects

I am new to MFC, but not entirely new, but I wanted to ask experts on this forum why one can choose one project over another. Hope this is not a stupid question as I am relatively new to MFC.

Thank you very much

+4
source share
3 answers

Choose on which template your application is best suited:

Single Document Interface (SDI) - if your application needs to work with only one document or data object or data set at a time

Example: notepad.exe


Multiple Document Interface (MDI) - if your application needs to work with multiple documents or data objects or data set at one time

Example: Visual Studio


Dialog - for anything.

Example: Calculator


No matter what you choose, you still have the same features that are available to you at the end, and you can push it in some way. Thus, you do not limit yourself to where you start.

All options come with CWinApp, which is the base class for which you receive your MFC applications.

In the dialog application, you start with CDialog . Using the SDI application, you get started with CMainFrame, CDocument, and CView.

+9
source

If you choose an SDI project, you get the entire Model-View-Controller infrastructure. You get a document class (inheriting from CDocument), which ideally should contain all the data and a presentation class (inheriting from CView) for display. You are given a hosting frame with an already attached menu, and there are functions that you can override to save and load to a file.

If you have a dialog application, you will get one dialog box. It. Of course, this dialogue may appear in others, but the application essentially consists of a dialogue.

If you are developing a small application that performs only one task, a dialog application is suitable because you do not need service data.

If you are developing an application in which the user will load, edit and save data, then the SDI path will be more appropriate.

Answering your question, I politely asked if there is a good reason why you choose MFC on top of Windows Forms. I believe that MFC was a great technology throughout the day, but Visual Studio offers more sophisticated tools (if you are ready to go the .NET path).

+2
source

If the “document” is the right metaphor for your application, use SDI or MDI. (Only one document can be opened at a time, several if several.) When you think about it, the document metaphor is really not suitable for most applications.

+1
source

All Articles