ValidateHObject Method - neoVI API This method is used to determine if a driver object is valid.
C/C++ Declare
Copy int _stdcall icsneoValidateHObject ( void * hObject);
Visual Basic .NET Declare
Copy Public Declare Function icsneoValidateHObject Lib “icsneo40.dll” (ByVal hObject As IntPtr) As Integer
C# Declare
Copy [ DllImport (“ icsneo40 . dll ”)] public static extern int icsneoValidateHObject ( IntPtr hObject);
Parameters
hObject
[in] Specifies the driver object created by OpenNeoDevice .
Return Values
1 if the hObject is valid. 0 if the object is invalid.
Remarks
A driver object will be invalid if it was never initialized by OpenNeoDevice . Calling ClosePort will not invalidate a driver object; only FreeObject will do so.
Examples
C/C++ Example:
Copy if (Convert :: ToBoolean ( icsneoValidateHObject (m_hObject)))
{
cmdCheckHardwareHandle -> Text = "Good" ;
}
else
{
cmdCheckHardwareHandle -> Text = "Lost" ;
}
C# Example:
Copy if ( Convert . ToBoolean ( icsNeoDll . icsneoValidateHObject (m_hObject)))
{
cmdCheckHardwareHandle . Text = "Good" ;
}
else
{
cmdCheckHardwareHandle . Text = "Lost" ;
}
Visual Basic .NET Example:
Copy If (CBool(icsneoValidateHObject(m_hObject))) Then
cmdCheckHardwareHandle.Text = "Good"
Else
cmdCheckHardwareHandle.Text = "Lost"
End If