Como detecto el COM del mi Modem
Estoy haciendo una aplicacion en VB6 usando el modem y quiero saber como hago para que mi aplicacion automaticamente detecte en que puerto de comunicaciones (COM) esta conectado mi MODEM??
Si me pueden ayudar se lo agradeceria!!!!
Si me pueden ayudar se lo agradeceria!!!!
con este codigo buscamos los puertos para localizar en cual de ellos está instalado el modem.
Private Sub Command2_Click()
On Error GoTo errr:
Port = 1
PortinG:
MSComm1.CommPort = Port
MSComm1.PortOpen = True
Form1.MSComm1.Settings = "14400,N,8,1"
MSComm1.Output = "AT" + Chr$(13)
x = 1
Do: DoEvents
x = x + 1
If x = 1000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 2000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 3000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 4000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 5000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 6000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 7000 Then
MSComm1.PortOpen = False
Port = Port + 1
GoTo PortinG:
If MSComm1.CommPort >= 5 Then
errr:
MsgBox "Can't Find Modem!"
End If
End If
Loop Until MSComm1.InBufferCount >= 2
instring = MSComm1.Input
MSComm1.PortOpen = False
Text1.Text = MSComm1.CommPort & instring
MsgBox "Modem Localizado en el Comm" & Port
End Sub
Private Sub Command2_Click()
On Error GoTo errr:
Port = 1
PortinG:
MSComm1.CommPort = Port
MSComm1.PortOpen = True
Form1.MSComm1.Settings = "14400,N,8,1"
MSComm1.Output = "AT" + Chr$(13)
x = 1
Do: DoEvents
x = x + 1
If x = 1000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 2000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 3000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 4000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 5000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 6000 Then MSComm1.Output = "AT" + Chr$(13)
If x = 7000 Then
MSComm1.PortOpen = False
Port = Port + 1
GoTo PortinG:
If MSComm1.CommPort >= 5 Then
errr:
MsgBox "Can't Find Modem!"
End If
End If
Loop Until MSComm1.InBufferCount >= 2
instring = MSComm1.Input
MSComm1.PortOpen = False
Text1.Text = MSComm1.CommPort & instring
MsgBox "Modem Localizado en el Comm" & Port
End Sub
