Documents, Views, and the Framework

HomeOverviewHow Do ISampleTutorial

At the heart of the MFC framework are the concepts of document and view. A document is a data object with which the user interacts in an editing session. It is created by the New or Open command on the File menu and is typically saved in a file. (Don't confuse standard MFC documents, derived from class CDocument, with Active documents or OLE compound documents.) A view is a window object through which the user interacts with a document.

The key objects in a running application are:

In a running application, these objects cooperatively respond to user actions, bound together by commands and other messages. A single application object manages one or more document templates. Each document template creates and manages one or more documents (depending on whether the application is SDI or MDI). The user views and manipulates a document through a view contained inside a frame window. The figure Objects in a Running SDI Application below shows the relationships among these objects for an SDI application.

Objects in a Running SDI Application

The rest of this family of articles explains how the framework tools, AppWizard, ClassWizard, WizardBar, and the resource editors, create these objects, how they work together, and how you use them in your programming. Documents, views, and frame windows are discussed in more detail in Window Objects: Overview and Document/View Architecture: Overview.