38.9.4.7 Error code string conversion (status information attached)

Converts error codes returned by various APIs in the WinGP SDK into error messages.

Returns an error message with status information attached, if possible.

EasyLoadErrorMessage() always returns the same error message as the defined error code. EasyLoadErrorMessageEx() returns more detailed information, such as the name of the communication partner, where the error occurred, and status when the error occurred. Even the same error code could return different error messages, depending on the location of the error.

EasyLoadErrorMessageEx(), EasyLoadErrorMessageExM() return a multi-byte string message (ASCII)

EasyLoadErrorMessageEx(), EasyLoadErrorMessageExM() return a string message (UNICODE)

Function Name

BOOL WINAPI EasyLoadErrorMessageEx(INT iErrorCode,LPSTR osErrorMessage);

BOOL WINAPI EasyLoadErrorMessageExW(INT iErrorCode,LPWSTR owsErrorMessage);

Argument

iErrorCode: (In) Error code returned by the WinGP SDK function

osErrorMessage: (Out) Pointer to the area where the converted string (ASCII) is stored (prepare for 1024 bytes or more.)

osErrorMessage: (Out) Pointer to the area where the converted string (UNICODE) is stored (prepare for 2048 bytes or more.)

Return value (NULL)

Successful operation: Any value other than zero

Failed to convert string (for example, unused error code): 0

Special Item