CAN DragonEmSA
functionEnumeration and Connection

EmSACAN_GetLastError

Prototype

wchar_t *EmSACAN_GetLastError(
    emsacan_handle_t Handle,
    wchar_t *pErrorMessage,
    int MaxMessageLength );

Description

Copies the last error message after a failed API call.

Parameters

ParameterDirectionTypeDescription
Handleinemsacan_handle_tSession handle, or NULL for last process-wide error.
pErrorMessageoutwchar_tBuffer to receive the message (wide string).
MaxMessageLengthinintSize of pErrorMessage in *characters(not bytes).

Example

wchar_t msg[256];
EmSACAN_GetLastError(handle, msg, 256);
wprintf(L"Error: %s\n", msg);

See also