Application Object Samples

Every Windows application using the Microsoft Foundation Class Library must implement a CWinApp derived class and create only one object of that class. See the SCRIBBLE tutorial sample and Visual C++ Tutorials for an introduction to application objects and for an example of an application that relies on document template (CDocTemplate) objects to manage the creation of frame windows, document objects, and view objects.

Note   For an example of a console application that uses the Microsoft Foundation Class Library but does not have a CWinApp derived class, see the MAKEHM sample.

CWinApp provides the WinMain function required by Windows, implements the main message loop, and coordinates the creation of frame windows, documents, and views using document template objects. CWinApp also provides secondary functionality at the high application level. The following samples illustrate some of these secondary CWinApp features:

If your application does not lend itself to a document/view architecture, you do not have to use document templates, documents, and views, as illustrated in the following samples:

See Also

Microsoft Foundation Class Library Samples Index