home *** CD-ROM | disk | FTP | other *** search
- frmPhoneDialler
-
- General/Declarations
- Option Explicit
-
- Private Sub cmdClosePort_Click()
- If MSComm.PortOpen = True Then
- MSComm.PortOpen = False
- End If
- End Sub
-
- Private Sub cmdDial_Click()
- On Error GoTo InvalidPort
- MSComm.CommPort = MyPort%
- MSComm.PortOpen = True
- If txtNumberToDial <> "" Then
- MSComm.Settings = Trim$(BaudRate$ & "," & Parity$ & "," & DataBits$ & "," & StopBits$)
- MSComm.Output = DialType$ & txtNumberToDial + Chr$(13)
- Else
- MSComm.PortOpen = False
- MsgBox "Please enter a number to dial."
- End If
- Exit Sub
- InvalidPort:
- MsgBox "Modem not found on the port you have currently selected."
- If MSComm.PortOpen = True Then
- MSComm.PortOpen = False
- End If
- Exit Sub
- End Sub
-
- Private Sub Form_Load()
- MsgBox "Default settings in use: Tone dialling, Com 1, 9600, N, 8, 1."
- DialType$ = "ATDT"
- MyPort% = 1
- BaudRate$ = "9600"
- Parity$ = "N"
- DataBits$ = "8"
- StopBits$ = "1"
- End Sub
-
- Private Sub Form_Unload(Cancel As Integer)
- If MSComm.PortOpen = True Then
- MSComm.PortOpen = False
- End If
- End Sub
-
- Private Sub mnuCommSettings_Click()
- frmCommSettings.Show 1
- End Sub
-
- Private Sub mnuExit_Click()
- End
- End Sub
-