In VB6.0, communication controls are in "Project" - "Part", select Microsoft Comm Control6.0
Its file is MScomm32.ocx
One of the only events of the control is the oncomm event. As the COMMEVENT attribute value changes, the following Case program code is triggered. This is automatically detected. (Different from timing detection)
ON Community
Select Case Mscomm1.commmevent
Case COMEVCD 'CD line status changes
If mscomm1.cdholding then 'If the DCD foot potential is high
Else
.
END IF
Case ComeVcts' CTS line status changes
Case Comevdsr 'DSR line status changes
Case comVRING 'Ring Indicator Change
Case comVReceive 'receives a minimum acceptance of characters
Case comvsend 'Transfer buffer has a minimum transfer character number character
Case ComeveOf 'Enter the data stream to discover EOF characters
End SELECT