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
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.
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
Enter the document extension and filter.
Select "None" to set no database support.
User Interface Features
Select the frame window features. Go with default selections.
Select the advanced feature support. Go with default selections.
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.
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) || 0 || 0|
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: