Create a single-document project using the MFC App Wizard in VC++ 5.0/6.0

Using VC 5.0/6.0

2026-09-18

Written by: xiaobin

The Architecture

Supporting the coordination of application data and data renderings is a perfect job for a framework. And when Microsoft released MFC 2.0 in early 1993, it included a document/view architecture within MFC. MFC’s document/view architecture deals with the data management and User-Interface issues just described.

As an aside, MFC’s document/view is not a new idea. It was first created by the folks at Xerox PARC (by the same company that invented graphical user interface) and was a key part of ther Smalltalk environment. Smalltalk’s version of document/view is called model-view-controller(MVC)(where model=document). The Smalltalk MVC architecture has a controller(kind of like CDocTemplate in MFC) that acts like a shield between the document and the view so that they do not get too dependent on each other.

class diagram

Figure 12-3 Image source: Beginning Visual C++ 2013

Document/View

A document is a collection of data in your application with which the user interacts.

Although the word document seems to imply something of a textual nature, it isn’t limited to text. It could be data for a game, a geometric model, a text file, or, indeed, anything you want.

The term document is just a convenient label for the application data in your program, treated as a unit.

object diagram

uses dashed arrows to show how pointers are used to relate objects. These pointers enable function members of one object to access the public data or function members in the interface of another object.

Figure 12-2

project

name: SdiSquares
vc56: Images compatible with both VC 5.0 and VC 6.0
vc5/6: The left side is VC 5.0; the right side is VC 6.0.

new project - vc6.0

single document - vc5.0 single document- vc6.0

database support

compound - vc5.0 compound- vc6.0

menu - vc5.0 menu- vc6.0

loc

comments - vc5.0 comments- vc6.0

CSquaresApp
CSquaresDoc
CSquaresView
SquaresDoc
SquaresView

CSquaresApp

CSquaresDoc

CSquaresView

Ref