Compartir a través de


Document Classes

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Document Classes.

Document class objects, created by document-template objects, manage the application's data. You will derive a class for your documents from one of these classes.

Document class objects interact with view objects. View objects represent the client area of a window, display a document's data, and allow users to interact with it. Documents and views are created by a document-template object.

CDocument
The base class for application-specific documents. Derive your document class or classes from CDocument.

COleDocument
Used for compound document implementation, as well as basic container support. Serves as a container for classes derived from CDocItem. This class can be used as the base class for container documents and is the base class for COleServerDoc.

COleLinkingDoc
A class derived from COleDocument that provides the infrastructure for linking. You should derive the document classes for your container applications from this class instead of from COleDocument if you want them to support links to embedded objects.

CRichEditDoc
Maintains the list of OLE client items that are in the rich edit control. Used with CRichEditView and CRichEditCntrItem.

COleServerDoc
Used as the base class for server-application document classes. COleServerDoc objects provide the bulk of server support through interactions with COleServerItem objects. Visual editing capability is provided using the class library's document/view architecture.

CHtmlEditDoc
Provides, with CHtmlEditView, the functionality of the WebBrowser HTML editing platform within the context of the MFC document-view architecture.

Document class objects can be persistent — in other words, they can write their state to a storage medium and read it back. MFC provides the CArchive class to facilitate transferring the document's data to a storage medium.

CArchive
Cooperates with a CFile object to implement persistent storage for objects through serialization (see CObject::Serialize).

Documents can also contain OLE objects. CDocItem is the base class of the server and client items.

CDocItem
Abstract base class of COleClientItem and COleServerItem. Objects of classes derived from CDocItem represent parts of documents.

See Also

Class Overview