The OnVComm event is triggered automatically everytime a communication event occurrs.
Private Sub FTVirtualSerialControlObject_OnVComm(ByVal EventType As EventConstants, ByVal Value As Long)
void CSiteWindowName::OnVCommFTVirtualSerialControl(EventConstants EventType, LONG Value)
procedure FTVirtualSerialControlObjectOnVComm(ASender: TObject; const EventType: EventConstants, Value: Long)
EventType argument specifies type of communication event. Refer to EventConstants for details.
The following code example demonstrates ports opening/closing handler.
Private Sub FTVirtualSerialPort1_OnVComm(ByVal aType As FTVSPCLibCtl.EventConstants, ByVal Value As Long)
Select Case aType
Case VspcOpenClose
If Value <> 0 Then
' Port is closed
Else
' Port is opened
End If
End Select
End Sub
void CSample1Dlg::OnOnVCommFtvirtualserialport1(long Type, long Value)
{
switch (Type) {
case VspcOpenClose:
if (Value)
// Port is opened
else
// Port is closed
break;
}
}