IPortableDeviceServiceMethods::Cancel method (portabledeviceapi.h)

The Cancel method cancels a pending method invocation.

Syntax

HRESULT Cancel(
  [in] IPortableDeviceServiceMethodCallback *pCallback
);

Parameters

[in] pCallback

A pointer to the callback object whose method invocation is to be canceled, or NULL to cancel all pending method invocations.

Return value

If the method succeeds, it returns S_OK. Any other HRESULT value indicates that the call failed.

Remarks

A callback object identifies a method invocation. If the same callback object is reused for multiple calls to the InvokeAsync method, all method invocations arising from these calls will be cancelled.

To enable targeted cancellation of a specific method invocation, pass a unique instance of the IPortableDeviceServiceMethodCallback interface to the InvokeAsync method.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server None supported
Target Platform Windows
Header portabledeviceapi.h

See also

IPortableDeviceServiceMethods Interface