Working together, documents and views:
- Contain, manage, and display your application-specific data.
- Provide an interface consisting of document data variables for manipulating the data.
- Participate in writing and reading files.
- Participate in printing.
- Handle most of your application's commands and messages.
The document is particularly involved in managing data. Store your data, normally, in document class member variables. The view uses these variables to access the data for display and update. The document's default serialization mechanism manages reading and writing the data to and from files. Documents can also handle commands (but not Windows messages other than WM_COMMAND).
What do you want to know more about?
- Deriving a document class from CDocument
- Managing data with document data variables
- Serializing data to and from files
- Bypassing the serialization mechanism
- Handling commands in the document
- The OnNewDocument member function
- The DeleteContents member function