Deriving a Document Class from CDocument

OverviewHow Do I

Documents contain and manage your application's data. To use the AppWizard-supplied document class, you must do the following:

  • Derive a class from CDocument for each type of document.

  • Add member variables to store each document's data.

  • Override CDocument's Serialize member function in your document class. Serialize writes and reads the document's data to and from disk.

Other Document Functions Often Overridden

You may also want to override other CDocument member functions. In particular, you will often need to override and to initialize the document's data members and to destroy dynamically allocated data. For information about overridable members, see class in the Class Library Reference.