Solved

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

Posted on 1997-10-14
9
276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…

730 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