How to retrieve the MODEM COMM PORT number??? 
Author Message
 How to retrieve the MODEM COMM PORT number???

How can I programatically retrieve through my VB6 app the modem Comm Port
for the system the app is running on?  For example, is there a reliable way
to retrieve this though a user's Registry and/or through API commands?

Thanks in advance.



Sun, 15 Sep 2002 03:00:00 GMT  
 How to retrieve the MODEM COMM PORT number???
Hi,

You can find out what ports have had modems installed.  However, the
physical modem may have been removed (without being uninstalled), or there
may be more than one modem present.  What is your goal?

--
Richard Grier (Microsoft Developer MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order.  For faster service contact the publisher at
http://www.mabry.com.



Sun, 15 Sep 2002 03:00:00 GMT  
 How to retrieve the MODEM COMM PORT number???
Richard, thanks once again for offering a helping hand.  My VB6 app needs to
occassionally make use of the user's modem and (unless I'm wrong about this)
that often involves needing to know the port on which the user's modem
communicates.  (Say for example I want to check to see if the modem is
currently available for what I'm about to allow the user to do... I would
need to check through the appropriate port... wouldn't I?)

I could of course be wrong about most of my assumptions here.  I look
forward as always to your feedback.


Quote:
> Hi,

> You can find out what ports have had modems installed.  However, the
> physical modem may have been removed (without being uninstalled), or there
> may be more than one modem present.  What is your goal?

> --
> Richard Grier (Microsoft Developer MVP)
> Hard & Software
> 12962 West Louisiana Avenue
> Lakewood, CO  80228
> 303-986-2179 (voice)
> 303-986-3143 (fax)
> Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
> Edition (355 pages).
> For information look on my homepage at http://www.hardandsoftware.net.
> Use the Books link to order.  For faster service contact the publisher at
> http://www.mabry.com.



Sun, 15 Sep 2002 03:00:00 GMT  
 How to retrieve the MODEM COMM PORT number???
Hi,

(Say for example I want to check to see if the modem is
currently available for what I'm about to allow the user to do... I would
need to check through the appropriate port... wouldn't I?)
<<

What I do is to use MSComm to attempt to open each serial port, in sequence
(use On Error Resume Next to trap open errors), if the port opens
successfully, I send "ATV1Q0" & vbCr -- then wait for an "OK" & vbCrLf
response.  If a response is received, that modem is available.  You can keep
a list of all available modems in your own registry entries (update each
time the program runs), to refer to when you next execute your program.  If
a port fails to open, you can use Err.Number to determine if the failure was
because the port is in use by another program.  Another "feature" that you
can add to the mix is to monitor the UART CD bit.  If carrier detect is high
on a port, almost certainly that port is in use by an active, connected
modem.  I have code examples for each of these things in my book.

--
Richard Grier (Microsoft Developer MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order.  For faster service contact the publisher at
http://www.mabry.com.



Mon, 16 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to retrieve the MODEM COMM PORT number???

2. Comm Port Time-out Problem with Null Modem Cable and VB for Dos

3. Which comm port is modem on?

4. Modems and comm ports

5. Modem Comm Port ID - HELP!

6. Comm Port/Modem ?

7. Comm Port Time-out Problem with Null Modem Cable and VB for Dos

8. How to acces the comm and the modem ports without using an ocx

9. Checking Comm port for Modem

10. Determine modems and comm ports present...

11. Modem Comm Port(s) and Name(s)

12. Release a comm port used by rouge modem

 

 
Powered by phpBB® Forum Software