IOleObject  2PFLZC0

The IOleObject interface is the principal means by which an embedded object provides basic functionality to, and communicates with, its container.

When to Implement

An object application must implement this interface, along with at least IDataObjectZHWNNR and IPersistStorageQIWSID, for each type of embedded object that it supports. Although this interface contains 21 methods, only three are nontrivial to implement and must be fully implemented: DoVerb, SetHostNames, and Close. Six of the methods provide optional functionality, which, if not desired, can be implemented to return E_NOTIMPL: SetExtent, InitFromData, GetClipboardData, SetColorScheme, SetMoniker, and GetMoniker. The latter two methods are useful mainly for enabling links to embedded objects.

When to Use

Call the methods of this interface to enable a container to communicate with an embedded object. A container must call DoVerb to activate an embedded object, SetHostNames to communicate the names of the container application and container document, and Close to move an object from a running to a loaded state. Calls to all other methods are optional.

Methods in VTable Order

IUnknown Methods

Description

QueryInterface2Y54585

Returns pointers to supported interfaces.

AddRef1SHW0SS

Increments reference count.

ReleaseDUW01A

Decrements reference count.

 

IOleObject Methods

Description

SetClientSite5OQXLV_

Informs object of its client site in container.

GetClientSite45EE_K_

Retrieves object s client site.

SetHostNames1RLGG49

Communicates names of container application and container document.

CloseAY9NYV

Moves object from running to loaded state.

SetMoniker1NNB4RF

Informs object of its moniker.

GetMonikerLSQLL9

Retrieves object s moniker.

InitFromDataUSL5MD

Initializes embedded object from selected data.

GetClipboardDataAIL312

Retrieves a data transfer object from the Clipboard.

DoVerb_MJX2P

Invokes object to perform one of its enumerated actions ( verbs ).

EnumVerbs1SPTBEN

Enumerates actions ( verbs ) for an object.

Update1DWTHC

Updates an object.

IsUpToDate2149ZI3

Checks if object is up to date.

GetUserClassID10.JHXW

Returns an object s class identifier.

GetUserTypeVLMZIO

Retrieves object s user-type name.

SetExtent1OQFEWS

Sets extent of object s display area.

GetExtent338UI6

Retrieves extent of object s display area.

Advise0BK13S

Establishes advisory connection with object.

Unadvise22X3DZP

Destroys advisory connection with object.

EnumAdviseS9OUP3

Enumerates object s advisory connections.

GetMiscStatus162TMUY

Retrieves status of object.

SetColorSchemeKEECEA

Recommends color scheme to object application.