Compartir a través de


OleSetContainedObject (Windows CE 5.0)

Send Feedback

This function notifies an object embedded in an OLE container to ensure correct reference.

WINOLEAPIOleSetContainedObject(LPUNKNOWNpUnk,BOOLfContained);

Parameters

  • pUnk
    [in] Pointer to the IUnknown interface of the object.
  • fContained
    [in] Boolean that is set to TRUE if the object is an embedded object, or to FALSE otherwise.

Return Values

The following HRESULT values can be returned.

Value Description
S_OK The object was notified.
E_OUTOFMEMORY The function has failed.
E_INVALIDARG The function has failed.
E_UNEXPECTED The function has failed.

Remarks

Passing invalid (and under some circumstances NULL) pointers into this function causes an unexpected termination of the application.

The OleSetContainedObject function notifies an object that it is embedded in an OLE container.

The implementation of OleSetContainedObject was changed in OLE 2.01 to coincide with the publication of the IRunnableObject interface.

You can use OleSetContainedObject and the IRunnableObject::SetContainedObject method interchangeably.

The OleSetContainedObject function queries the object for a pointer to the IRunnableObject interface. If successful, the function returns the results of calling IRunnableObject::SetContainedObject.

The implementation of OleSetContainedObject in earlier versions of OLE differs from that described here.

To determine whether the platform supports this function, see Determining Supported COM APIs.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Ole2.h.
Link Library: Ole32.lib.

See Also

Automation Functions | IUnknown | IRunnableObject | IRunnableObject::SetContainedObject | Determining Supported COM APIs

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.