EQuestionAnswers.com Computer/Electronics Questions and Answers
C, C++, VC++, COM/DCOM, DLL and more
#Login #Sign up  Facebook Twitter TGoogle+

#Previous question #Index of VC++/WIN32/MFC Questions #Next question

SDI Application components

A Single document interface application should include 1) Document class, 2) View Class, 3) Frame class 4) Application class


Document is the class to manage data part of the objects. Application often derives a class from CDocument. This deals with saving and retrieving data fields to and from the file stream. MFC often uses CArchive and serialization process to do the same. Users however have other options like direct CFile calls to synch the data to file syatem or query SQL server to do the same. Document module also deals with the logic to maintain the data and also responsible for managing different attributes of the data.


View is the class module to display data of the document. A derived class of CView is often used for this purpose. This display part can be the display of the document in graphical form or with UI elements or in the form of printable view which contains formatted text.


MFC framework uses a Frame window or class CFrame to display window in the screen and thus a CFrame class is always needed in any application which follows document view architecture.


All MFC applications should have an application class defined and derived from CWinApp base class. SDI application should define the same. This class manages the creation of main thread in the application and the starup function initinstance should create objects of doc and view. MFC application should create an global object

SDI wizard

User can write all these class headers and implementations manually. All these header and C++ files should be included in an MFC project. Manually creating these files are tedious process and it consumes time. However these are basic SDI frameword skeleton and MFC provides wizard to do these automatically. Wizard creates a step by step dialog to take inputs from user and generates the necessary files needed for the project. Wizard creates all header, C++ source, resource and project files. Lets see the


Overview step is the introduction step. It displays all the steps those will come in this wizard.

Application type

There are options like Single Document", "Multiple Documents" and "Dialog based". Select application type as "Single Document". Select project style as "MFC Standard". This will prepare the editor look like old "MFC/VC++ editor"

Compound document type

Select none.

Document template

Enter the document extension and filter.

Database support

Select "None" to set no database support.

User Interface Features

Select the frame window features. Go with default selections.

Advanced Features

Select the advanced feature support. Go with default selections.

Generated Classes

Change the filenames for "View", "App", "Doc", and Frame classes. Go with default names.

Generated Classes - View

Change the filenames for "View" or go with default names.

Generated Classes - App

Change the filenames for "App" or go with default names.

Generated Classes - Doc

Change the filenames for "Doc" or go with default names.

Generated Classes - Frame

Change the filenames for "Frame" or go with default names.

Press finish at the end. VC++ will open a project will all the populated sources and resouces.

You have viewed 1 page out of 109. Your VC++ learning is 0.00% complete. Login to check your learning progress.

 Vote 0

Similar topics related to this section

#Programming Windows, Fifth Edition (Developer Reference)
#Programming Applications for Microsoft Windows (Microsoft Programming Series)
#Programming Windows with MFC, Second Edition
#Visual C++ Programming
#Programming Microsoft Visual C++, Fifth Edition

* #1 webmaster Sun 27 Apr/2014 09:49:41(GMT)  Like 0 Unlike 0

Dear Users,

We are pleased to inform you that a forum/blog has been incorporated with www.mybestnotes.co.in. You are welcomed to add your comments, requests, codes, solutions and feedback to it. Please login(if already a member) or signup(for free) to avail to this facility.


Your message goes here:

My Post:*
Secutiry Code: ******  *
Preview this compose before posting this in discussion forum.
  1. Use [Sxx] code to show smiles. Example [S02]
  2. Use [URL ], example [URL http://www.google.com/]
  3. To display code or un formatted text use [CODE] [/CODE]. Example: [CODE] printf("Hello world"); [/CODE]
 [S01]   [S02]   [S03]   [S04]   [S05]   [S06]   [S07]   [S08] 
 [S09]   [S10]   [S11]   [S12]   [S13]   [S14]   [S15]   [S16] 
 [S17]   [S18]   [S19]   [S20]   [S21]   [S22]   [S23]   [S24] 

Note: Only members are allowed, * fields are mandatory.