Compartilhar via


OleSetContainedObject

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

WINOLEAPI OleSetContainedObject( 
  LPUNKNOWN pUnk, 
  BOOL fContained
); 

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 table shows the HRESULT values that can be returned by this function.

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

Remarks

Passing into this function any invalid and, under some circumstances, NULL pointers will result in 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.

**Note   **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

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

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.