共用方式為


COleClientItem Class

Defines the container interface to OLE items.

class COleClientItem : public CDocItem

Members

Public Constructors

Name

Description

COleClientItem::COleClientItem

Constructs a COleClientItem object.

Public Methods

Name

Description

COleClientItem::Activate

Opens the OLE item for an operation and then executes the specified verb.

COleClientItem::ActivateAs

Activates the item as another type.

COleClientItem::AttachDataObject

Accesses the data in the OLE object.

COleClientItem::CanCreateFromData

Indicates whether a container application can create an embedded object.

COleClientItem::CanCreateLinkFromData

Indicates whether a container application can create a linked object.

COleClientItem::CanPaste

Indicates whether the Clipboard contains an embeddable or static OLE item.

COleClientItem::CanPasteLink

Indicates whether the Clipboard contains a linkable OLE item.

COleClientItem::Close

Closes a link to a server but does not destroy the OLE item.

COleClientItem::ConvertTo

Converts the item to another type.

COleClientItem::CopyToClipboard

Copies the OLE item to the Clipboard.

COleClientItem::CreateCloneFrom

Creates a duplicate of an existing item.

COleClientItem::CreateFromClipboard

Creates an embedded item from the Clipboard.

COleClientItem::CreateFromData

Creates an embedded item from a data object.

COleClientItem::CreateFromFile

Creates an embedded item from a file.

COleClientItem::CreateLinkFromClipboard

Creates a linked item from the Clipboard.

COleClientItem::CreateLinkFromData

Creates a linked item from a data object.

COleClientItem::CreateLinkFromFile

Creates a linked item from a file.

COleClientItem::CreateNewItem

Creates a new embedded item by launching the server application.

COleClientItem::CreateStaticFromClipboard

Creates a static item from the Clipboard.

COleClientItem::CreateStaticFromData

Creates a static item from a data object.

COleClientItem::Deactivate

Deactivates the item.

COleClientItem::DeactivateUI

Restores the container application's user interface to its original state.

COleClientItem::Delete

Deletes or closes the OLE item if it was a linked item.

COleClientItem::DoDragDrop

Performs a drag-and-drop operation.

COleClientItem::DoVerb

Executes the specified verb.

COleClientItem::Draw

Draws the OLE item.

COleClientItem::GetActiveView

Gets the view on which the item is activated in place.

COleClientItem::GetCachedExtent

Returns the bounds of the OLE item's rectangle.

COleClientItem::GetClassID

Gets the present item's class ID.

COleClientItem::GetClipboardData

Gets the data that would be placed on the Clipboard by calling the CopyToClipboard member function.

COleClientItem::GetDocument

Returns the COleDocument object that contains the present item.

COleClientItem::GetDrawAspect

Gets the item's current view for rendering.

COleClientItem::GetExtent

Returns the bounds of the OLE item's rectangle.

COleClientItem::GetIconFromRegistry

Retrives a handle to an icon associated with the server of a particular CLSID.

COleClientItem::GetIconicMetafile

Gets the metafile used for drawing the item's icon.

COleClientItem::GetInPlaceWindow

Returns a pointer to the item's in-place editing window.

COleClientItem::GetItemState

Gets the item's current state.

COleClientItem::GetLastStatus

Returns the status of the last OLE operation.

COleClientItem::GetLinkUpdateOptions

Returns the update mode for a linked item (advanced feature).

COleClientItem::GetType

Returns the type (embedded, linked, or static) of the OLE item.

COleClientItem::GetUserType

Gets a string describing the item's type.

COleClientItem::IsInPlaceActive

Returns TRUE if the item is in-place active.

COleClientItem::IsLinkUpToDate

Returns TRUE if a linked item is up to date with its source document.

COleClientItem::IsModified

Returns TRUE if the item has been modified since it was last saved.

COleClientItem::IsOpen

Returns TRUE if the item is currently open in the server application.

COleClientItem::IsRunning

Returns TRUE if the item's server application is running.

COleClientItem::OnActivate

Called by the framework to notify the item that it is activated.

COleClientItem::OnActivateUI

Called by the framework to notify the item that it is activated and should show its user interface.

COleClientItem::OnChange

Called when the server changes the OLE item. Implementation required.

COleClientItem::OnDeactivate

Called by the framework when an item is deactivated.

COleClientItem::OnDeactivateUI

Called by the framework when the server has removed its in-place user interface.

COleClientItem::OnGetClipboardData

Called by the framework to get the data to be copied to the Clipboard.

COleClientItem::OnInsertMenus

Called by the framework to create a composite menu.

COleClientItem::OnRemoveMenus

Called by the framework to remove the container's menus from a composite menu.

COleClientItem::OnSetMenu

Called by the framework to install and remove a composite menu.

COleClientItem::OnShowControlBars

Called by the framework to show and hide control bars.

COleClientItem::OnUpdateFrameTitle

Called by the framework to update the frame window's title bar.

COleClientItem::ReactivateAndUndo

Reactivates the item and undoes the last in-place editing operation.

COleClientItem::Release

Releases the connection to an OLE linked item and closes it if it was open. Does not destroy the client item.

COleClientItem::Reload

Reloads the item after a call to ActivateAs.

COleClientItem::Run

Runs the application associated with the item.

COleClientItem::SetDrawAspect

Sets the item's current view for rendering.

COleClientItem::SetExtent

Sets the bounding rectangle of the OLE item.

COleClientItem::SetHostNames

Sets the names the server displays when editing the OLE item.

COleClientItem::SetIconicMetafile

Caches the metafile used for drawing the item's icon.

COleClientItem::SetItemRects

Sets the item's bounding rectangle.

COleClientItem::SetLinkUpdateOptions

Sets the update mode for a linked item (advanced feature).

COleClientItem::SetPrintDevice

Sets the print-target device for this client item.

COleClientItem::UpdateLink

Updates the presentation cache of an item.

Protected Methods

Name

Description

COleClientItem::CanActivate

Called by the framework to determine whether in-place activation is allowed.

COleClientItem::OnChangeItemPosition

Called by the framework when an item's position changes.

COleClientItem::OnDeactivateAndUndo

Called by the framework to undo after activation.

COleClientItem::OnDiscardUndoState

Called by the framework to discard the item's undo state information.

COleClientItem::OnGetClipRect

Called by the framework to get the item's clipping-rectangle coordinates.

COleClientItem::OnGetItemPosition

Called by the framework to get the item's position relative to the view.

COleClientItem::OnGetWindowContext

Called by the framework when an item is activated in place.

COleClientItem::OnScrollBy

Called by the framework to scroll the item into view.

COleClientItem::OnShowItem

Called by the framework to display the OLE item.

Remarks

An OLE item represents data, created and maintained by a server application, which can be "seamlessly" incorporated into a document so that it appears to the user to be a single document. The result is a "compound document" made up of the OLE item and a containing document.

An OLE item can be either embedded or linked. If it is embedded, its data is stored as part of the compound document. If it is linked, its data is stored as part of a separate file created by the server application, and only a link to that file is stored in the compound document. All OLE items contain information specifying the server application that should be called to edit them.

COleClientItem defines several overridable functions that are called in response to requests from the server application; these overridables usually act as notifications. This allows the server application to inform the container of changes the user makes when editing the OLE item, or to retrieve information needed during editing.

COleClientItem can be used with either the COleDocument, COleLinkingDoc, or COleServerDoc class. To use COleClientItem, derive a class from it and implement the OnChange member function, which defines how the container responds to changes made to the item. To support in-place activation, override the OnGetItemPosition member function. This function provides information about the displayed position of the OLE item.

For more information about using the container interface, see the articles Containers: Implementing a Container and Activation.

Note

The Windows SDK refers to embedded and linked items as "objects" and refers to types of items as "classes." This reference uses the term "item" to distinguish the OLE entity from the corresponding C++ object and the term "type" to distinguish the OLE category from the C++ class.

Inheritance Hierarchy

CObject

CCmdTarget

CDocItem

COleClientItem

Requirements

Header: afxole.h

See Also

Reference

CDocItem Class

Hierarchy Chart

COleServerItem Class

Concepts

MFC Sample MFCBIND

MFC Sample OCLIENT