TheWizardofInt
01-03-2002, 03:01 PM
Here is some code that hanps up a modem (in VB6 using the MSComm object)
It works in Win98 and Win2K pro but NOT Win NT4.0
Any idea?
iPause = 10
Private Sub HangUp()
On Error Resume Next
MSComm1.Output = "AT" + vbCr
Wait iPause
MSComm1.Output = "ATH0" + vbCr
Wait iPause
' Close the port.
MSComm1.PortOpen = False
Wait iPause
CancelButton.Enabled = False
DialButton.Enabled = True
CancelFlag = True
On Error GoTo 0
End Sub
Private Sub Wait(iWait As Integer)
Dim i As Long
Dim sRead As String
Dim lStall As Long
lStall = iWait
lStall = lStall * 10000
For i = 0 To lStall
sRead = Status
Next i
End Sub
It works in Win98 and Win2K pro but NOT Win NT4.0
Any idea?
iPause = 10
Private Sub HangUp()
On Error Resume Next
MSComm1.Output = "AT" + vbCr
Wait iPause
MSComm1.Output = "ATH0" + vbCr
Wait iPause
' Close the port.
MSComm1.PortOpen = False
Wait iPause
CancelButton.Enabled = False
DialButton.Enabled = True
CancelFlag = True
On Error GoTo 0
End Sub
Private Sub Wait(iWait As Integer)
Dim i As Long
Dim sRead As String
Dim lStall As Long
lStall = iWait
lStall = lStall * 10000
For i = 0 To lStall
sRead = Status
Next i
End Sub