QLIB-function: QAPIGetLastError


The QAPIGetLastError function retrieves the calling thread's last-error code value. The last-error code is maintained on a per-thread basis. Multiple threads do not overwrite each other's last-error code.

ULONG QAPIGetLastError(void);


Return value
The return value is the calling thread's last-error code value. The Return value section of each reference page notes the conditions under which the function sets the last-error code.

Commands
To obtain an error string for system error codes, use the QAPIGetLastErrorStringEx function. For a complete list of error codes provided by the operating system, see Error Codes.

You should call the QAPIGetLastError function immediately when a QAPIxxxx function's returns and you think there can be an error. After calling QAPIConnect and during a remote network session you should always check the return code because network errors can occur anytime during program execution.

The error codes returned by the QAPIGetLastError function are not part of the Windows API specification. They are QLIB ( QUANCOM Driver Library ) specific error codes. If you get a ERROR_GETLASTERROR or ERROR_WSAGETLASTERROR then call the QAPIGetLastErrorCode to get an extended error code..

 Back to the QLIB overview