Dialer program

I want to build a dialer program.
The user input the dialer string, and then the PC
check the modem status, and then dial.
The PC can know: the modem is ready? there is
a telephone tone? It dial success?  It is hanged up by remote
modem? the modem have connected to remote modem?

That means I want to dial and display the dialing status.

Please give me suggestion or sample code.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

To use a control that comes with VB, use the MSComm control. The OnComm event of this control will pretty much tell you all of the things you listed above. Here's the example for it :
Private Sub MSComm_OnComm ()
   Select Case MSComm1.CommEvent
   ' Handle each event or error by placing
   ' code below each case statement

   ' Errors
      Case comEventBreak   ' A Break was received.
      Case comEventFrame   ' Framing Error
      Case comEventOverrun   ' Data Lost.
      Case comEventRxOver   ' Receive buffer overflow.
      Case comEventRxParity   ' Parity Error.
      Case comEventTxFull   ' Transmit buffer full.
      Case comEventDCB   ' Unexpected error retrieving DCB]

   ' Events
      Case comEvCD   ' Change in the CD line.
      Case comEvCTS   ' Change in the CTS line.
      Case comEvDSR   ' Change in the DSR line.
      Case comEvRing   ' Change in the Ring Indicator.
      Case comEvReceive   ' Received RThreshold # of
                        ' chars.
      Case comEvSend   ' There are SThreshold number of
                     ' characters in the transmit
                     ' buffer.
      Case comEvEof   ' An EOF charater was found in
                     ' the input stream
   End Select
End Sub

The documentation for all these return codes, and all the MSComm events, is too long to list in a comment box, but this should get you to the right docs in VB Help to get your job done.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hxbAuthor Commented:
Thank for your help.
I have read the help, but still can not know how to

Can you give me a sample code ?
Your Visual Basic CD does have good sample projects for you. Following is the information on what they are named and how to find them :

Sample Applications: Dialer.vbp and VBTerm.vbp

The Dialer.vbp and VBTerm.vbp sample applications which are listed in the Samples directory, demonstrate simple and complex (respectively) programming techniques of the Communications control.

The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

hxbAuthor Commented:
Thank for your help.

I have try the VBterm, and it is a good sample.

Now I have a problem, I can know that  the
CD is changed etc.
How can I sure that Dialer process is completed and I
can communicate now?
And how can I know the line is disconnected and must
dial again?
Where can I found more MSCOMM_Events description?

I believe you can use the Oncomm event, and check for a DTR status change. DTR will come up after the connect, and drop shortly before the disconnect.
hxbAuthor Commented:
how can I know if there is a device connected to the port I've assigned or the port is not available? Can you give me some codes on how can i know the port status?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.