Return a formatted error message string for the last error.
No direct call from VBA/VB6. Use errFormatErrorMessage
long __stdcall PKI_FormatErrorMessage(char *szOutput, long nOutChars, long nErrCode, const char *szUserMsg);
The number of characters that have been set in szOutput.
General.FormatErrorMessage Method
static std::string dipki::Err::FormatErrorMessage (int errCode=0, const std::string &userMsg="")
This is a combination of PKI_ErrorLookup, PKI_ErrorCode and PKI_LastError to give a complete formatted error message, for example
ERROR (11): Value out of range (OUT_OF_RANGE_ERROR) ERROR: User message! (11): Value out of range (OUT_OF_RANGE_ERROR) ERROR (21): No match found (NO_MATCH_ERROR): (1) Cannot open input file (OPEN_ERROR): Private key does not match any certificate in list
The equivalent functions in other languages are written independently and will give similar but not identical outputs.
The error message will never be longer than 1023 characters plus the length of any user message. In the raw ANSI C function you can query the expected length, but it is recommended to write directly to a fixed size buffer, as in the example below.
char szErrMsg[1024]; long errcode = 11; PKI_FormatErrorMessage(szErrMsg, sizeof(szErrMsg) - 1, errcode, "User message!"); printf("%s\n", szErrMsg);
ERROR: User message! (11): Value out of range (OUT_OF_RANGE_ERROR)
PKI_ErrorLookup PKI_ErrorCode PKI_LastError Error codes