Retrieves the error message associated with a given error code.
Public Declare Function PKI_ErrorLookup Lib "diCrPKI.dll"
(ByVal strOutput As String, ByVal nOutChars As Long, ByVal nErrCode As Long) As Long
nRet = PKI_ErrorLookup(strOutput, nOutChars, nErrCode)
long __stdcall PKI_ErrorLookup(char *szOutput, long nOutChars, long nErrCode);
The number of characters that have been set in szOutput. If the function is called with nOutChars set to zero or szOutput as NULL, the return value is the number of characters in the error message.
Public Function pkiErrorLookup
(nErrCode As Long) As String
static std::string dipki::Err::ErrorLookup (int errCode)
static Gen.error_lookup(n)
Specify a zero nOutChars or an empty string for szOutput to find the required length of the output string. ANSI C users must add one to this value when allocating memory.
The error message will never be longer than 127 characters (PKI_MAX_ERRORLOOKUP_CHARS).
Dim nLen As Long
Dim nErrCode As Long
Dim strErrMsg As String * 128
nErrCode = 25
nLen = PKI_ErrorLookup(strErrMsg, Len(strErrMsg), nErrCode)
Debug.Print "ErrorLookup(" & nErrCode & ")=" & Left(strErrMsg, nLen)
This should return
ErrorLookup(25)=Certificate issuer error
Dim nErrCode As Long
For nErrCode = 1 To 11
Debug.Print nErrCode & " = " & pkiErrorLookup(nErrCode)
Next