getWin32ErrorCode

Return the error code of the last Win32 API function to fail.
getWin32ErrorCode([out, retval] int *code)
Returns the error code of the last Win32 API function to fail on this thread. The error code comes from GetLastError. Note that some Win32 functions don't set the error code – see the MSDN documentation for details.

Call clearWin32ErrorInfo first to clear any saved function name and error code.

Each thread has its own, independent saved error function and code.

This function is only available on Windows.

Win32 error info is currently saved only for printing functions.

VB6:
On Error GoTo e pdf.clearWin32ErrorInfo ... pdf.printPDF4 ... e: func = pdf.getWin32ErrorFunc code = pdf.getWin32ErrorCode If func <> "" Then ' ... error was caused by [func] / [code] End If
clearWin32ErrorInfo
getWin32ErrorFunc