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, REFIID iid, void **ppUnk );
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.
The globally unique identifier of an interface on the cancel object for the call to be canceled. This argument is usually IID_ICancelMethodCalls.
Receives the address of a pointer to the interface specified by riid.
This function can return the standard return values E_FAIL, E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values.
||The call control object was retrieved successfully.|
||The object on which the call is executing does not support the interface specified by riid.|
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.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Header||combaseapi.h (include Objbase.h)|