GetErrorMessages Method - neoVI API

This method reads the neoVI DLL error message queue.

int _stdcall icsneoGetErrorMessages(void * hObject, int *pErrorMsgs, int *pNumberOfErrors);

Parameters

hObject

[in] Specifies the driver object created with OpenNeoDevice.

pErrorMsgs

[out] This is the address of the first element of an array of long variables of at least 600 elements. This array will be loaded with the current error queue. The error queue will contain errors generated by all threads, not just the current thread. A separate topic describes the possible values for error messages. You can get a text description of this error using GetErrorInfo.

pNumberOfErrors

[out] Specifies the number of errors copied into the pErrorMsgs buffer. The maximum value will be 600.

Return Values

Returns 1 if successful, 0 on failure.

Remarks

The error queue will be reset after this method is called.

Examples

int iErrors[599];
int lResult;
int lNumberOfErrors;
TCHAR szOut[200];
long lCount;

// 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 to the debug window
if(lNumberOfErrors > 0)
{
    for(lCount=0;lCount <lNumberOfErrors; lCount++)
    {
        wsprintf(szOut,TEXT("Error %d\n"),iErrors[lCount]);
        OutputDebugString(szOut);
    }
}
else
    OutputDebugString(TEXT("No Errors to report\n"));

Last updated