ValidateHObject 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 is used to determine if a driver
object is valid.
C/C++ Declare
int
_stdcall
icsneoValidateHObject(int hObject);
Visual Basic Declare
Public Declare Function icsneoValidateHObject
Lib "icsneo40.dll" (ByVal hObject
As Long) As Long
Visual Basic .NET Declare
Public Declare Function
icsneoValidateHObject Lib "icsneo40.dll" (ByVal hObject
As Integer) As Integer
C# Declare
[DllImport("icsneo40.dll")]
public static
extern int
icsneoValidateHObject(int 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
Visual Basic Example
If
(icsneoValidateHObject(m_hObject)) Then
cmdCheckHardwareHandle.Caption = "Good"
Else
cmdCheckHardwareHandle.Caption = "Lost"
End
If
C/C++ Example:
if(Convert::ToBoolean(icsneoValidateHObject(m_hObject)))
{
cmdCheckHardwareHandle->Text =
"Good";
}
else
{
cmdCheckHardwareHandle->Text =
"Lost";
}
C# Example:
if (Convert.ToBoolean (icsNeoDll.icsneoValidateHObject(m_hObject)))
{
cmdCheckHardwareHandle.Text = "Good";
}
else
{
cmdCheckHardwareHandle.Text = "Lost";
}
Visual Basic .NET Example:
If (CBool(icsneoValidateHObject(m_hObject)))
Then
cmdCheckHardwareHandle.Text = "Good"
Else
cmdCheckHardwareHandle.Text = "Lost"
End
If
| intrepidcs
API Documentation - (C) Copyright 2000-2010 Intrepid Control Systems, Inc.
(www.intrepidcs.com) |
Last Updated :
Thursday, December 04, 2008