0 out of 1 rated this helpful - Rate this topic

CoGetCancelObject function

Applies to: desktop apps only

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.

Syntax

HRESULT CoGetCancelObject(
  __in   DWORD dwThreadId,
  __in   REFIID iid,
  __out  void **ppUnk
);

Parameters

dwThreadId [in]

The identifier of the thread on which the pending COM call is to be canceled. If this parameter is 0, the call is on the current thread.

iid [in]

The globally unique identifier of an interface on the cancel object for the call to be canceled. This argument is usually IID_ICancelMethodCalls.

ppUnk [out]

Receives the address of a pointer to the interface specified by riid.

Return value

This function can return the standard return values E_FAIL, E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values.

Return codeDescription
S_OK

The call control object was retrieved successfully.

E_NOINTERFACE

The object on which the call is executing does not support the interface specified by riid.

 

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.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ