Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: WinSock
Expertise: Beginner
May 2, 1999

Phone dialer

Question:
Is it possible to connect and disconnect a Microsoft phone dialer that calls my Internet service provider from a VB program?

Answer:
It sure is, and VB makes it very easy. The Microsoft Comm Control (MSCOMM32.OCX) that ships with the Enterprise edition of VB allows you to interact with serial ports on your computer. To dial a phone number follow these steps:

1. Add the MSCOMM control to the Toolbox and then place it on a form.
2. Set the CommPort property to the number of the port the modem is connected to. Try 2 MSComm1.CommPort=2
3. Set the Settings property to specify the Baud rate, parity, data bits, and stop bit. You can usually leave this property at its default value which is:

MSComm1.Settings = "9600,N,8,1"

4. Open the communications port:

MSComm1.PortOpen = True

5. Dial the number using a string made up of the Hayes-compatible command set (AT starts the connection, D dials, T specifies Touch Tone):

MSComm1.Output ="ATDT" & Number$ & vbCr

6. To disconect the modem:

MSComm1.Output = "ATH" + vbCr

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date