Scrivendo il codice sotto riportato VB6 mi dice che manca un oggetto e mi segnala MSCOMM1 Perchè?
Ecco il codice:
Private Sub cmdcon_Click()
If MSComm1.PortOpen = True Then
Exit Sub
End If
MSComm1.CommPort = cbocomm.ListIndex + 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True
End Sub
Private Sub cmddis_Click()
If MSComm1.PortOpen = False Then
Exit Sub
Else
MSComm1.PortOpen = False
End If
End Sub
Private Sub cmdoff_Click()
MSComm1.Output = "0"
End Sub
Private Sub cmdon_Click()
MSComm1.Output = "1"
End Sub
Private Sub mnuexit_Click()
End
End Sub
Private Sub Timer1_Timer()
If MSComm1.PortOpen = True Then
lblstate.Caption = "Connected"
lblstate.ForeColor = vbGreen
cmdon.Enabled = True
cmdoff.Enabled = True
Else
lblstate.Caption = "Disconnected"
lblstate.ForeColor = vbRed
cmdon.Enabled = False
cmdoff.Enabled = False
End If
End Sub