IOleObject
A version of this page is also available for
4/8/2010
This 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 IDataObject and IPersistStorage, 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:
Six methods provide optional functionality, which, if not desired, can be implemented to return E_NOTIMPL:
- IOLEObject::SetExtent
- IOLEObject::InitFromData
- IOLEObject::GetClipboardData
- IOLEObject::SetColorScheme
- IOLEObject::SetMoniker (useful mainly for enabling links to embedded objects)
- IOLEObject::GetMoniker (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 the following:
- DoVerb to activate an embedded object
- SetHostNames to communicate the names of the container application and container document
- Close to move an object from a running to a loaded state
Calls to all other methods are optional.
Methods
The following table shows the methods for this interface in alphabetical order. Like all COM interfaces, this interface inherits the methods for the IUnknown interface.
Method | Description |
---|---|
This method establishes an advisory connection between an OLE object and the calling object's advise sink, through which the calling object receives notification when the compound document object is renamed, save, or closed. |
|
This method changes an embedded object from the running to the loaded state. It also disconnects a linked object from its link source. |
|
This method requests an object to perform an action in response to a user's action. |
|
This method retrieves a pointer to an enumerator that can be used to enumerate the advisory connections registered for an object, so a container knows what to release prior to closing down. |
|
This method exposes a pull-down menu listing the verbs available for an object in ascending order by verb number. |
|
This method obtains a pointer to an embedded object's client site. |
|
This method retrieves a data object that contains the current contents of the embedded object on which this method is called. Using the pointer to this data object, it is possible to create an embedded object with the same data as the original. |
|
This method retrieves a running object's current display size. |
|
This method returns a value that indicates the status of an object at creation and loading. |
|
This method retrieves an embedded object's moniker, which the caller can use to link to the object. |
|
This method returns the object class identifier (CLSID) corresponding to the string identifying the object to an end-user. |
|
This method retrieves the user type name of an object for display in user interface elements such as menus, list boxes, and dialog boxes. |
|
This method initializes a newly created object with data from a specified data object, which can reside either in the same container or on the clipboard. |
|
This method checks recursively whether or not an object is current. |
|
This method informs an embedded object of its display location, called a "client site", within its container. |
|
This method specifies the color palette that the object application should use when it edits the specified object. |
|
This method informs an object of how much display space its container has assigned it. |
|
This method provides an object with the name of its container application and the compound document in which it is embedded. |
|
This method notifies an object of its container's moniker, the object's own moniker relative to the container, or the object's full moniker. |
|
This method deletes a previously established advisory connection. |
|
This method updates an object handler's or link object's data to view caches. |
Remarks
To determine whether the platform supports this interface, see Determining Supported COM APIs.
Requirements
Header | Oleidl.h, oleidl.idl |
Library | oleaut32.lib, uuid.lib |
Windows Embedded CE | Windows CE 2.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |