AddTapi.NET Developer's Manual
GetCommHandle Method
NamespacesTraysoft.AddTapiTapiCallGetCommHandle()()()
Obtains a handle of the open communication port associated with the call.
Declaration Syntax
C#Visual BasicVisual C++
public IntPtr GetCommHandle()
Public Function GetCommHandle As IntPtr
public:
IntPtr GetCommHandle()
Return Value
IntPtr that incapsulates a Win32 handle of the open communication port.
Remarks

GetCommHandle obtains a handle of the open communication port of the data modem. Returned handle can be used to transfer data between the application and the remote terminal. The telephony service provider opens the port in overlapped I/O mode and configures the port using the settings specified in the Control Panel. The application can set additional configuration options for the device by using communications functions with the returned handle.

The application assumes ownership of the returned handle. The handle must be closed using CloseHandle Win32 function before the call is disconnected (before calling Disconnect()()()). We recommend using SafeFileHandle wrapper to manage the returned handle.

Exceptions
ExceptionCondition
TapiDisconnectExceptionThe call has been already disconnected.
TapiExceptionAddTapi.NET cannot obtain a handle because a TAPI error occurred.

Assembly: Traysoft.AddTapi (Module: Traysoft.AddTapi)