Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 5: The Document/View Architecture



  1. Close the window and return to MSVC


From now on, when you are asked to create an SDI, refer to this section.^

5.5.2 An MDI With AppWizard..................................................................


To reduce the amount of work involved with creating an MDI, you can use the MFC's
AppWizard. To do this, in the MFC AppWizard, select the Multiple Document radio
button.

If you want to create an application that would use a single type of document, select the
desired base class.

If you want to create a Windows Explorer type of application, you should select a Single
Document application type and select the project style as Windows Explorer. Then, in the
Generated Classes section or the MFC AppWizard Step 6, specify a class for the left
frame and another base class for the right frame. A classic example would have
TreeView class for the left pane and a CListView class for the right side.

If you have created an SDI, you can change it into a multi-view application by adding a
CView-derived class to the application. For example, in MSVC 6, if you had created an
SDI based on a tree view and you want to create a second view as a form for the right
frame, right-click the first node in Class View and click New Form.
Free download pdf