CoGetCancelObject

[This is preliminary documentation and subject to change.]

Obtains a pointer to a call control interface, normally ICancelMethodCalls, on the cancel object corresponding to an outbound COM method call pending on the same or another client thread.

HRESULT CoGetCancelObject(
  DWORD dwThreadID,  //Thread with pending call
  REFIID riid,       //ID of requested interface
  void **ppUnk       //Pointer to requested interface
);
 

Parameters

dwThreadID
Identifier of the thread on which the pending COM call is to be canceled. If 0, the call is on the current thread.
riid
Globally unique identifier of an interface on the cancel object for the call to be canceled. This argument is normally IID_ICancelMethodCalls.
ppUnk
Address of a pointer to the interface specified by riid.

Return Values

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

S_OK
The call control object was obtained.
E_NOINTERFACE
The object on which the call is executing does not implement the requested interface.

Remarks

If two or more calls are pending on the same thread through nested calls, the thread ID may not be sufficient to identify the call to be canceled. In this case, CoGetCancelObject returns a cancel interface corresponding to the innermost call that is pending on the thread and has registered a cancel object.

This function does not locate cancel objects for asynchronous calls.

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in objbase.h.
  Import Library: Included as a resource in ole32.dll.