次の方法で共有


COleDocument Class

The base class for OLE documents that support visual editing.

class COleDocument : public CDocument

Members

Public Constructors

Name

Description

COleDocument::COleDocument

Constructs a COleDocument object.

Public Methods

Name

Description

COleDocument::AddItem

Adds an item to the list of items maintained by the document.

COleDocument::ApplyPrintDevice

Sets the print-target device for all client items in the document.

COleDocument::EnableCompoundFile

Causes documents to be stored using the OLE Structured Storage file format.

COleDocument::GetInPlaceActiveItem

Returns the OLE item that is currently in-place active.

COleDocument::GetNextClientItem

Gets the next client item for iterating.

COleDocument::GetNextItem

Gets the next document item for iterating.

COleDocument::GetNextServerItem

Gets the next server item for iterating.

COleDocument::GetPrimarySelectedItem

Returns the primary selected OLE item in the document.

COleDocument::GetStartPosition

Gets the initial position to begin iteration.

COleDocument::HasBlankItems

Checks for blank items in the document.

COleDocument::OnShowViews

Called when the document becomes visible or invisible.

COleDocument::RemoveItem

Removes an item from the list of items maintained by the document.

COleDocument::UpdateModifiedFlag

Marks the document as modified if any of the contained OLE items have been modified.

Protected Methods

Name

Description

COleDocument::OnEditChangeIcon

Handles events in the Change Icon menu command.

COleDocument::OnEditConvert

Handles the conversion of an embedded or linked object from one type to another.

COleDocument::OnEditLinks

Handles events in the Links command on the Edit menu.

COleDocument::OnFileSendMail

Sends a mail message with the document attached.

COleDocument::OnUpdateEditChangeIcon

Called by the framework to update the command UI for the Edit/Change Icon menu option.

COleDocument::OnUpdateEditLinksMenu

Called by the framework to update the command UI for the Edit/Links menu option.

COleDocument::OnUpdateObjectVerbMenu

Called by the framework to update the command UI for the Edit/ObjectName menu option and the Verb submenu accessed from Edit/ObjectName.

COleDocument::OnUpdatePasteLinkMenu

Called by the framework to update the command UI for the Paste Special menu option.

COleDocument::OnUpdatePasteMenu

Called by the framework to update the command UI for the Paste menu option.

Remarks

COleDocument is derived from CDocument, which allows your OLE applications to use the document/view architecture provided by the Microsoft Foundation Class Library.

COleDocument treats a document as a collection of CDocItem objects to handle OLE items. Both container and server applications require such an architecture because their documents must be able to contain OLE items. The COleServerItem and COleClientItem classes, both derived from CDocItem, manage the interactions between applications and OLE items.

If you are writing a simple container application, derive your document class from COleDocument. If you are writing a container application that supports linking to the embedded items contained by its documents, derive your document class from COleLinkingDoc. If you are writing a server application or combination container/server, derive your document class from COleServerDoc. COleLinkingDoc and COleServerDoc are derived from COleDocument, so these classes inherit all the services available in COleDocument and CDocument.

To use COleDocument, derive a class from it and add functionality to manage the application's non-OLE data as well as embedded or linked items. If you define CDocItem-derived classes to store the application's native data, you can use the default implementation defined by COleDocument to store both your OLE and non-OLE data. You can also design your own data structures for storing your non-OLE data separately from the OLE items. For more information, see the article Containers: Compound Files..

CDocument supports sending your document via mail if mail support (MAPI) is present. COleDocument has updated OnFileSendMail to handle compound documents correctly. For more information, see the articles MAPI and MAPI Support in MFC..

Inheritance Hierarchy

CObject

CCmdTarget

CDocument

COleDocument

Requirements

Header: afxole.h

See Also

Reference

CDocument Class

Hierarchy Chart

Concepts

MFC Sample CONTAINER

MFC Sample MFCBIND