GetLastAPIError Method - intrepidcs API
C/C++ declare - VB declare - VB.NET declare - C# declare - Parameters - Return Values - Remarks - C/C++ example - VB example - VB.NET example - C# example

This method returns the error generated by the last API call.

C/C++ Declare

int _stdcall icsneoGetLastAPIError(int hObject int *piErrorNumber);

Visual Basic Declare

Public Declare Function icsneoGetLastAPIError Lib "icsneo40.dll" (ByVal hObject As Long, ByRef piErrorNumber As Long) As Long

Visual Basic .NET Declare

Public Declare Function icsneoGetLastAPIError Lib "icsneo40.dll" (ByVal hObject As Integer, ByRef piErrorNumber As Integer) As Integer

C# Declare

[DllImport("icsneo40.dll")]
public static extern int icsneoGetLastAPIError(int hObject, ref int piErrorNumber);

Parameters

hObject
   
[in] Specifies the driver object created by OpenNeoDevice.

piErrorNumber
  [out] The value of the error generated by the previous API call will be returned. The text description of the error can then be obtained by calling GetErrorInfo

  

Return Values

If an error was generated and stored during the last API call then 1 will be returned. 0 will be returned if no error was generated since the port was opened or the last time that GetLastAPIError was called. The stored error will be cleared after this call. API errors are generated and stored on a 'per-thread' basis. The calling thread will only receive errors generated within it's own context. If a new API error is generated before the previous error has been retrieved, the previous error will be lost. All errors generated can still be retrieved using GetErrorMessages. However, GetErrorMessages will return errors generated in all threads, not just the current thread.

Remarks


Examples

Visual Basic Example

C/C++ Example:

C# Example:

Visual Basic .NET Example:

intrepidcs API Documentation - (C) Copyright 2000-2012 Intrepid Control Systems, Inc.  (www.intrepidcs.com)

Last Updated : Wednesday, September 17, 2008