Returns the error code of the error that occurred when calling the last function.
Public Declare Function API_ErrorCode Lib "diCryptoSys.dll" () As Long
nRet = API_ErrorCode()
long __stdcall API_ErrorCode(void);
None.
Returns the error code of the error that occurred when calling the last function, or zero if no error occurred.
General.ErrorCode Method
General.FormatErrorMessage Method
static int crsysapi::Err::ErrorCode ()
static Gen.error_code()
The value returned is always a non-negative integer greater than or equal to zero. Not all functions set this value.
Dim nErrCode as Long
nErrCode = API_ErrorCode()
Debug.Print "API_ErrorCode=" & API_ErrorCode() & ": " & apiErrorLookup(API_ErrorCode())
API_ErrorCode=19: Item is not supported (NOT_SUPPORTED_ERROR)
A sample function in C to display error details.
/** Display error codes and corresponding message. @param nRet Error code returned by last function. */ static void disp_error(long nRet) { long errcode; char errmsg[128] = { 0 }; // Get error that occurred when calling last function (if any) errcode = API_ErrorCode(); // Lookup message for error code if (errcode != 0) API_ErrorLookup(errmsg, sizeof(errmsg), errcode); else API_ErrorLookup(errmsg, sizeof(errmsg), nRet); printf("ERROR Returned=%ld/Code=%ld: %s\n", nRet, errcode, errmsg); }
HASH_DigestLength returns -64 ERROR Returned=-64/Code=64: Invalid context handle (INVALID_HANDLE_ERROR)