GetErrorInfo Method - neoVI API

This method returns a text description of an neoVI API error number.

int _stdcall icsneoGetErrorInfo(int lErrorNumber, 
            TCHAR *szErrorDescriptionShort,  
            TCHAR  *szErrorDescriptionLong,
            int *lMaxLengthShort,
            int *lMaxLengthLong,
            int *lErrorSeverity,
            int *lRestartNeeded);

Parameters

lErrorNumber [in] This is the number of the error message returned from GetErrorMessages. A separate topic describes the possible values for error messages.

sErrorDescriptionShort [out] This is short description of the error. This parameter should be sized to include up to 255 characters including the NULL terminator.

sErrorDescriptionLong [out] This is longer more detailed description of the error. This parameter should be sized to include up to 255 characters including the NULL terminator. lMaxLengthShort [in] This is the size in characters of the sErrorDescriptionShort array that is being passed in. This value must be 255 or less. lMaxLengthLong [in] This is the size in characters of the sErrorDescriptionLong array that is being passed in. This value must be 255 or less.

lErrorSeverity [out] This indicates the error severity. This is estimated severity for the application and doesn't have significant meaning. See Table 1 below for more information.

lRestartNeeded [out] If 1 it is recommend that the application close communications with the DLL and reopen it.

Return Values

If the error number was found successfully the return value will be non-zero.

Remarks

None.

Table 1 - Descriptions of Error Severity

Examples

// Read the errors from the DLL
lResult = icsneoGetErrorMessages(hObject,iErrors,&lNumberOfErrors);

if (lResult == 0)
    MessageBox(hWnd,TEXT("Problem Reading errors"),TEXT("neoVI Example"),0);

// dump the neoVI errors
if (lNumberOfErrors > 0)
{
    for (lCount=0;lCount <lNumberOfErrors;lCount++)
    {

        wsprintf(szOut,TEXT("Error %d - "),iErrors[lCount]);
            OutputDebugString(szOut);
            icsneoGetErrorInfo(iErrors[lCount],szDescriptionShort,szDescriptionLong,
                        &lMaxLengthShort,&lMaxLengthLong,&lErrorSeverity,&lRestartNeeded);

        OutputDebugString(szDescriptionShort);
        OutputDebugString(TEXT("\n"));
    }
}
else
    OutputDebugString(TEXT("No Errors to report\n"));

Last updated