OnVComm Event

Description

The OnVComm event is triggered automatically everytime a communication event occurrs.

Syntax

Visual Basic

Private Sub FTVirtualSerialControlObject_OnVComm(ByVal EventType As EventConstants, ByVal Value As Long)

Visual C++

void CSiteWindowName::OnVCommFTVirtualSerialControl(EventConstants EventType, LONG Value)

Delphi

procedure FTVirtualSerialControlObjectOnVComm(ASender: TObject; const EventType: EventConstants, Value: Long)

Remarks

EventType argument specifies type of communication event. Refer to EventConstants for details.

The following code example demonstrates ports opening/closing handler.

Visual Basic

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

Visual C++

void CSample1Dlg::OnOnVCommFtvirtualserialport1(long Type, long Value)
{
    switch (Type) {
    case VspcOpenClose:
        if (Value)
            // Port is opened
        else
            // Port is closed
        break;
    }
}