Edit

Share via


CDocItem Class

The base class for document items, which are components of a document's data.

Syntax

class CDocItem : public CCmdTarget

Members

Public Methods

Name Description
CDocItem::GetDocument Returns the document that contains the item.
CDocItem::IsBlank Determines whether the item contains any information.

Remarks

CDocItem objects are used to represent OLE items in both client and server documents.

For more information, see the article Containers: Implementing a Container.

Inheritance Hierarchy

CObject

CCmdTarget

CDocItem

Requirements

Header: afxole.h

CDocItem::GetDocument

Call this function to get the document that contains the item.

CDocument* GetDocument() const;

Return Value

A pointer to the document that contains the item; NULL, if the item is not part of a document.

Remarks

This function is overridden in the derived classes COleClientItem and COleServerItem, returning a pointer to either a COleDocument, a COleLinkingDoc, or a COleServerDoc object.

CDocItem::IsBlank

Called by the framework when default serialization occurs.

virtual BOOL IsBlank() const;

Return Value

Nonzero if the item contains no information; otherwise 0.

Remarks

By default, CDocItem objects are not blank. COleClientItem objects are sometimes blank because they derive directly from CDocItem. However, COleServerItem objects are always blank. By default, OLE applications containing COleClientItem objects that have no x or y extent are serialized. This is done by returning TRUE from an override of IsBlank when the item has no x or y extent.

Override this function if you want to implement other actions during serialization.

See also

CCmdTarget Class
Hierarchy Chart
COleDocument Class
COleServerItem Class
COleClientItem Class