Retrieves the error message associated with a given error code.
Public Declare Function API_ErrorLookup Lib "diCryptoSys.dll"
(ByVal strOutput As String, ByVal nMaxChars As Long, ByVal nErrorCode As Long) As Long
nRet = API_ErrorLookup(strOutput, nMaxChars, nErrorCode)
long __stdcall API_ErrorLookup(char *szOutput, long nMaxChars, long nErrCode);
the number of characters in the output string or zero if there is no corresponding error message.
Public Function apiErrorLookup
(nCode As Long) As String
General.ErrorLookup Method
General.FormatErrorMessage Method
static std::string crsysapi::Err::ErrorLookup (int errCode)
static std::string crsysapi::Err::FormatErrorMessage (int errCode=0)
static Gen.error_lookup(n)
The error message will never be longer than 127 characters.
Dim nErrCode As Long
nErrCode = 33
Debug.Print "ErrorLookup(" & nErrCode & ")=" & apiErrorLookup(nErrCode)
ErrorLookup(33)=Invalid key length (BAD_KEY_LEN_ERROR)
To display all possible error messages:
Dim nRet As Long
Dim strErrMsg As String * 128
Dim i As Integer
For i = 0 To 10000
nRet = API_ErrorLookup(strErrMsg, Len(strErrMsg), i)
If (nRet > 0) Then
Debug.Print i & " = " & Left(strErrMsg, nRet)
End If
Next