Partager via


OleSetContainedObject

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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

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 Value

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

Header ole2.h
Library ole32.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Automation Functions
IUnknown
IRunnableObject
IRunnableObject::SetContainedObject

Concepts

Determining Supported COM APIs