|
PortController.NET
PortHandle Property
Returns an IntPtr HANDLE to the open communications port.
Syntax
[Visual Basic]
object.PortHandle
[C#]
object.PortHandle
[C++]
object->PortHandle
Parameters
object
An object expression that evaluates to a PortController object.
Return Value
An IntPtr HANDLE to the currently open communications port.
Remarks
- The returned handle to the communications port may be used as the file handle in unmanaged Win32 function calls.
- This property is read-only.
Errors
Reading the PortHandle property while the port is closed is not permitted
and will cause PortController to throw a "Port is closed" exception.
Example
[Visual Basic]
Dim portHandle As IntPtr
portHandle = myPortController.PortHandle
[C#]
IntPtr portHandle = myPortController.PortHandle;
[C++]
IntPtr portHandle = myPortController->PortHandle;
See Also
PortName property
|