Previous | Next |
Returns the result of a file transfer.
Syntax
NSFile.Result
Return Values
The value returned corresponds to a Microsoft® COM HRESULT error code.
The Result property returns the following values.
Decimal value | Mnemonic | Description |
0 | S_OK | Transfer was successful. |
-2147467260 | E_ABORT | Transfer was cancelled. The cancellation can come from the sender or the receiver. |
-2147467259 | E_FAIL | Transfer failed. |
-2147287038 | STG_E_FILENOTFOUND | File is not found, or no file is found that matches a wild card or filter. For example, if the receiver expects a file named Fremont.avi and the sender sends Ballard.avi, this error is returned. |
-2147024882 | E_OUTOFMEMORY | Out of memory. |
-2147024809 | E_INVALIDARG | Invalid argument was provided to a method or property. |
-2147023436 | ERROR_TIMEOUT | The transfer failed because the receiver timed out. This value is converted to an HRESULT error code. |
Remarks
The Result property returns the value of a file transfer. For example, a method call to start the receive operation can return S_OK, but the transfer can return E_OUTOFMEMORY when the transfer is completed. It is recommended that the return value of a method call be checked for errors when the call is made, and that the Result value be checked when the transfer is completed.
If invalid parameters are entered for a method and the transfer has not yet started, the Result property is not set. If invalid arguments are entered and a transfer has already started, the Result property is set.
The Result property applies only to the last transfer. When a new transfer begins, the Result property is reset.
If an error occurs during a transfer, the caller must query NumFilesTransferred and NumDirectoriesTransferred to determine how many files and directory structures were transferred before the transfer failed.
Unknown error message values from the Windows operating system are passed through the control and converted to HRESULT values. To convert a Microsoft Win32 system error, you must have the Win32 SDK and the latest copy of the Winerror.h file. To convert from an HRESULT to a Winerror.h value, subtract the hexadecimal value of 0x80070000 from the returned error code, and then convert to decimal.
Previous | Next |