次の方法で共有


OleSetContainedObject (Compact 2013)

3/26/2014

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

See Also

Tasks

Determine Supported COM APIs

Reference

OLE Functions
Automation Functions
IUnknown
IRunnableObject
IRunnableObject::SetContainedObject