Solved

Need to find all modem's com ports...

Posted on 1997-10-14
9
256 Views
Last Modified: 2013-12-03
I need to be able to find the com port of the modems installed in Win95 & NT.  I have no problem finding the general information for the modems in both operating systems' registries.  What I can't figure out is the key that is the comport.  I have tried "AttatchedTo"... but this key doesn't exists for PCMCIA modems.
0
Comment
Question by:Doldrums
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 7

Expert Comment

by:faster
ID: 1407580
I think instead of checking the registry, you can do a search on all the com ports, for example send any at commands and see whether "OK" is returned.
0
 
LVL 3

Expert Comment

by:vinniew
ID: 1407581
Why not use the CreateFile function and check the error code on each?  If it's an error, it will tell you what kind of error.  For instance, and DEVICE_BUSY error would tell you that it is in use, and any other error would at least tell you if it exists.

In the registry, try:

hkLM/hardware/devicemap/serialcomm

It's not as reliable, though.
0
 

Author Comment

by:Doldrums
ID: 1407582
The [HKEY_LOCAL_MACHINE\hardware\devicemap\serialcomm] doesn't really help...

The idea about the CreateFile has me a bit lost...  am I to create a file to the comport???  I have a modem's name... I need to find the comport the modem is on.
0
 
LVL 3

Expert Comment

by:vinniew
ID: 1407583
You can use the CreateFile() API to access any handle in Win95/NT.  File handles, StdHandles, Communication handles.

The usage goes something like this:

CreateFile("\\COMM1".....);
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:Doldrums
ID: 1407584
Alright... so let's say I CreateFile for all the com ports.  This still doesn't give me anyway to find out what modem is on what port.

What I want to do is make a function that takes a modem's name and returns its comport.  Nothing more...
0
 
LVL 2

Expert Comment

by:amartin030297
ID: 1407585
You have 50% of the information you need.  Basically IF
you can identify that a modem exists on a comport (And
it does sound like the above suggestions will do this),
unless you use the registry to tell you the modem name
(which as we also see is not reliable), THEN >YOU<
must use 'detection techniques' to determine modem type.
So.. AT I6, etc.. you'll need the AT Commands for
Rockwell and USR chipsets (the big boys), as well as
AT&T, etc... Most smaller players buy their chipsets from
the big-boys.. But thats the ONLY way to get a modem 'name'...
  Sorry for the crappy news, but unless you can have windows
identify the name, you have to know the protocol to do it
youself.. Fortionately, the AT commands are pretty standard..
  -- Aaron

0
 

Author Comment

by:Doldrums
ID: 1407586
I found the answer to my question elsewhere.
Thanks to all who gave me their suggestions and comments.
0
 

Author Comment

by:Doldrums
ID: 1407587
The way to find it is that once you have the modem name... you can look at:
\\hkey_local_machine\enum\pcmcia\<modem-name>

Special thanks to John Leier of TurboPower Software for his answer!
http://www.turbopower.com

Sidenote:  I do *NOT* work for or have any affiliation with TurboPower.  But, now I *can* start to finally grow back all the hair that I pulled out!!! :)

Hugh
0
 
LVL 2

Accepted Solution

by:
amartin030297 earned 200 total points
ID: 1407588
well give SOMEONE the points!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now