Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Window 95 installed modem COM port using.

Posted on 1997-08-15
5
Medium Priority
?
202 Views
Last Modified: 2013-12-03
How to get window 95 installed modem configuration? Especially the COM port using by modem.  I know I can find configuration information in registry \HKEY_LOCAL_MACHINE\System\Class\Modem. But it is not working for all kind of modem. For external modem it is fine. For internal modems, most of time the COM port using information is missing. Please help.
0
Comment
Question by:hawyuan
[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
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:md041797
ID: 1404212
Use CreateFile on \\.\COM1, 2, 3, 4 to get a handle on each port.  For each valid handle call GetCommProperties.  The COMMPROP.dwProvSubType will have PST_MODEM if a modem is attached.  You should avoid the registry for this kind of thing.  MS has said these locations are subject to change in the future.
0
 

Author Comment

by:hawyuan
ID: 1404213
It is not working. The COMMPROP.dwProvSubType I got always is PST_RS232. Here is my testing program. Can you tell my anything wrong?

HANDLE  hComDev ;
BOOL    bRet ;
COMMPROP  CommProp ;

hComDev = CreateFile( "COM2",GENERIC_READ|GENERIC_WRITE,
                  0,                    // exclusive access
                  NULL,                 // no security attrs
                  OPEN_EXISTING,
                  FILE_ATTRIBUTE_NORMAL |
                  FILE_FLAG_OVERLAPPED, // overlapped I/O
                  NULL ) ;

bRet = GetCommProperties(hComDev,(LPCOMMPROP)&CommProp ) ;

I am trying to show user and let user select the modem they installed by using the modem option in control panel. In order to do this, I have to get the modem name and the COM port using.

0
 
LVL 4

Expert Comment

by:md041797
ID: 1404214
No, I don't know why this does not work.  My solution is probably the wrong way to do this.
0
 

Accepted Solution

by:
YZ earned 200 total points
ID: 1404215
All above mentioned approaches wonnt work if COM port being used
when you doing CreateFile(...) (it will return ACCESS_DENIED).
Anyway, this can be a sign that COM port really present in system, so just check for ACCESS_DENIED on return.

Second: How to get all installed modems in system ?
The answer is not easy: you shoud dig into RAS and TAPI.
If you interested, I can send you bunch of sources showing all
steps to get all modems/TAPI lines.

YZ.

0
 

Author Comment

by:hawyuan
ID: 1404216
Yes, please send me sources codes to show the steps to get all modems/TAPI lines.

Here is my e-mail address: hawyuan@gpetech.com

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

719 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