The Cancel method cancels the current operation,
returning control to the application. This method is typically used
to either cancel a file transfer, file listing, or connection
attempt. Once the operation has been canceled, the OnCancel
event will fire.
This method will return a value of zero if the action was
successful. Otherwise, a non-zero error code is returned which
indicates the cause of the failure.
In addition to the generation of an OnCancel event, the
cancelled operation may return a non-zero error code, or throw an
error.