WdCreateCancellationHandle
Creates a cancellation handle that can be used to cancel a copy operation started by WdRemoteCopy.Syntax
Parameters
_Out_ cancellationHandleType: WdCancellationHandle* Receives the newly created cancellation handle. The caller is responsible for freeing this handle by calling WdCloseCancellationHandle when it is no longer needed.
Return value
Type: HRESULT ReturnsS_OK if successful; otherwise, returns an error code.
Remarks
CallWdCreateCancellationHandle before starting a copy operation to obtain a handle that enables cancellation. Pass the handle to WdRemoteCopy via the cancellationHandle parameter, and then pass it to WdCancelRemoteCopy from a separate thread to cancel the operation.
After WdRemoteCopy returns, close the handle by calling WdCloseCancellationHandle. The handle can be reused across multiple WdRemoteCopy calls, but each handle must eventually be closed.
