Solved

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

Posted on 1997-10-14
9
271 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

828 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