> For the complete documentation index, see [llms.txt](https://docs.intrepidcs.com/neovi-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intrepidcs.com/neovi-api/win32-api-overview-intrepidcs-api/error-functions-overview-intrepidcs-api/geterrormessages-method-intrepidcs-api.md).

# GetErrorMessages Method - neoVI API

This method reads the neoVI DLL error message queue.

{% tabs %}
{% tab title="C/C++ Declare" %}

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

{% endtab %}

{% tab title="Visual Basic .NET Declare" %}

```vbnet
Public Declare Function icsneoGetErrorMessages Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByRef pErrorMsgs As Int32, ByRef pNumberOfErrors As Int32) As Int32
```

{% endtab %}

{% tab title="C# Declare" %}

```csharp
[DllImport(“icsneo40.dll”)] public static extern Int32 icsneoGetErrorMessages(IntPtr hObject, ref Int32 pErrorMsgs, ref Int32 pNumberOfErrors);
```

{% endtab %}
{% endtabs %}

**Parameters**

hObject

\[in] Specifies the driver object created with [OpenNeoDevice](/neovi-api/win32-api-overview-intrepidcs-api/basic-functions-overview-intrepidcs-api/openneodevice-method-intrepidcs-api.md).

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](/neovi-api/win32-api-overview-intrepidcs-api/error-functions-overview-intrepidcs-api/error-messages-intrepidcs-api.md). You can get a text description of this error using [GetErrorInfo](/neovi-api/win32-api-overview-intrepidcs-api/error-functions-overview-intrepidcs-api/geterrorinfo-method-intrepidcs-api.md).

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

{% tabs %}
{% tab title="C/C++ Example" %}

```cpp
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"));
```

{% endtab %}

{% tab title="Visual Basic .NET Example" %}

```vbnet
Dim lResult As Integer '//Storage for result of Function Call
Dim lErrors(600) As Integer '//Array for Error information
Dim lNumberOfErrors As Integer '//Storage for Number of Errors

'// Read Out the errors
lResult = icsneoGetErrorMessages(m_hObject, lErrors(0), lNumberOfErrors)

'// Test the returned result
If Not CBool(lResult) Then
    MsgBox("Problem Reading Errors")
End If
```

{% endtab %}

{% tab title="C# Example" %}

```csharp
int iResult = 0; //Storage for Result of Call
int[] iErrors = new int[600]; //Array for Error Numbers
int iNumberOfErrors = 0; // Storage for number of errors

// Read Out the errors
iResult = icsNeoDll.icsneoGetErrorMessages(m_hObject,ref iErrors[0],ref iNumberOfErrors);
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.intrepidcs.com/neovi-api/win32-api-overview-intrepidcs-api/error-functions-overview-intrepidcs-api/geterrormessages-method-intrepidcs-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
