OleSetContainedObject

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

At a Glance

Header file: Ole2.h
Windows CE versions: 2.0 and later

Syntax

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

This function supports the standard return values E_INVALIDARG, E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:

S_OK

The object was notified successfully.

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.