다음을 통해 공유


COleServerItem Class

Provides the server interface to OLE items.

class COleServerItem : public CDocItem

Remarks

A linked item can represent some or all of a server document. An embedded item always represents an entire server document.

The COleServerItem class defines several overridable member functions that are called by the OLE system dynamic-link libraries (DLLs), usually in response to requests from the container application. These member functions allow the container application to manipulate the item indirectly in various ways, such as by displaying it, executing its verbs, or retrieving its data in various formats.

To use COleServerItem, derive a class from it and implement the OnDraw and Serialize member functions. The OnDraw function provides the metafile representation of an item, allowing it to be displayed when a container application opens a compound document. The Serialize function of CObject provides the native representation of an item, allowing an embedded item to be transferred between the server and container applications. OnGetExtent provides the natural size of the item to the container, enabling the container to size the item.

For more information about servers and related topics, see the article Servers: Implementing a Server and "Creating a Container/Server Application" in the article Containers: Advanced Features.

Requirements

Header: afxole.h

See Also

Concepts

HIERSVR Sample: Demonstrates a Server Application with OLE Drag and Drop

COleServerItem Members

CDocItem Class

Hierarchy Chart

COleClientItem Class

COleServerDoc Class

COleTemplateServer Class