CryptoSys PKI Pro Manual

PKI_ErrorLookup

Retrieves the error message associated with a given error code.

VBA/VB6 Syntax

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)

C/C++ Syntax

long __stdcall PKI_ErrorLookup(char *szOutput, long nOutChars, long nErrCode);

Parameters

szOutput
[out] to receive error message.
nOutChars
[in] specifying the maximum length of the string to be copied.
nErrCode
[in] specifying the error code for which the message is required.

Returns (VBA/C)

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.

VBA Wrapper Syntax

Public Function pkiErrorLookup (nErrCode As Long) As String

.NET Equivalent

General.ErrorLookup Method

C++ (STL) Equivalent

static std::string dipki::Err::ErrorLookup (int errCode)

Python Equivalent

static Gen.error_lookup(n)

Remarks

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).

Example (VBA core function)

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

Example (VBA wrapper function)

Dim nErrCode As Long
For nErrCode = 1 To 11
    Debug.Print nErrCode & " = " & pkiErrorLookup(nErrCode)
Next

See Also

PKI_ErrorCode Error codes

[Contents] [Index]

[PREV: PKI_ErrorCode...]   [Contents]   [Index]   
   [NEXT: PKI_FormatErrorMessage...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.