Retrieving Modem Information

Environment: VC6 SP2, NT4 SP5
Alright folks, this post is the result of probably a hundred email requests over the past few months, in response to my original inquiry about how to retrieve modem information. Now I'm sure 'ol BG and the boys would probably take a different approach, but this one works for me.
It's very simply really. Run the included sample exe (included in the ZIP archive) to see what I mean.
// number of modems in machine const int GetModemCount() const; // reset string const CString GetModemResetString( const CString strName ) const; // init string, with optional desired volume level specified // error control on, compression on, hardward flow control, modulation CCITT, blind off, call setup fail timer, inactivity timer + if requested, includes volume init const CString GetModemInitString( const CString strName, const int nSpeakerVolume = -1 ) const; // com port const int GetModemComPort( const CString strName ) const; // maximum bps as per control panel const int GetModemBps( const CString strName ) const; // fills CComboBoxBox with list of modem names void FillComboBoxWithModemNames( CComboBox* pComboBox ); // fills CListBox control with list of modem names void FillListBoxWithModemNames( CListBox* pListBox ); // first listed non-virtual modem name in registry const CString GetFirstModemName() const; // modem name based on index const CString GetModemName( const int nIndex ) const; // does modem have speaker const BOOL GetModemHasSpeaker( const CString strName ) const; // how many volume levels? const int GetModemVolumeLevelsCount( const CString strName ) const; // is strName a valid modem? const BOOL GetIsModem( const CString strName ) const;
Example Usage:
CModemInfo ModemInfo; const CString strModemName = ModemInfo.GetFirstModemName(); const CString strInit = ModemInfo.GetModemInit( strModemName ); const int nComPort = ModemInfo.GetModemComPort( strModemName );
A more realistic usage of this class however, would be to use the member functions ::FillComboBoxWithModemNames() or ::FillListBoxWithModemNames() -- then once the user exits your modem setup window, you can retrieve the Initialization String, Com Port, and Maximum BPS using, based on the modem name they have selected.
Downloads
Download demo project (includes source) - 132 Kb

Comments
How to answer through headphone/mic to opposite client
Posted by Legacy on 11/05/2003 12:00amOriginally posted by: Jebin
-
Reply
Replysammmm
Posted by alagurajan on 03/07/2005 11:44pmdial-up by modem
Posted by Legacy on 05/24/2003 12:00amOriginally posted by: pham ky thanh
I want to build a program can auto dial by modem.
ReplyIn my program :
-I can know status of modem includes: sended speed , recieved speed , transfered speed.
-and more but I do not know what I should begin ?
Please help me . Thank you very much .
tel. number dissalow
Posted by Legacy on 04/30/2003 12:00amOriginally posted by: chm0d
how can i forbid the modem calling another number except the one stated in the dialog box when on the net(dialup)? thnx
ReplyHow talk over tephone using modem and headphone/mic ? ? ?
Posted by Legacy on 01/05/2003 12:00amOriginally posted by: Pradyumna Kumar Jena
dear sirs,
Replyi am using hayes commands to dial a telephone number. my connectivity is ok. but i am not able to talk using the headphone , connected to modem. but if i am using a telephone receiver connected parallally to the same modem , it is ok. but the problem is my program loose its control over the modem.
please guide me. . . .
With regards
Pradyumna
9810933342
Retrieving Modem Information
Posted by Legacy on 04/02/2002 12:00amOriginally posted by: babar
hello! i would like to know how the phone number of a client connecting to RAS can be obtained programatically!
Replyi need to implement a CLI system!
So many questions, almost no answers!
Posted by Legacy on 01/03/2002 12:00amOriginally posted by: Aldamo
Hi, people look for help, but nobody gives answers. Hey, gurus, where are you?
ReplyHELP!!! HELP!!! HELP!!!!
Posted by Legacy on 12/15/2001 12:00amOriginally posted by: Henry Liu
A question,please!
My modem has finish the job of dialing process,but without PPP connection. And how can I use serial port connected with that modem to serve RAS dailing. How to config or replace some modules?
Please
ReplyThanks
How can I use computer as a answering machine
Posted by Legacy on 09/29/2001 12:00amOriginally posted by: Praveen Mohania
I am working on a project which requires modem programming and aims at using computer as a answering machine.
If there is any one who can help me in modem programming or who has any software on this topic please help me
The project also requires an call identifier software which
Replycan detect the phone no. of the dialer If any one has a software on this or sorce code please help me. Language preference is VB or Vc++
How can i receive data from modem
Posted by Legacy on 09/26/2001 12:00amOriginally posted by: Muthamil Selvam. T
Now i am devleloping one project - automatic answering ,
in that i need a program to recives a phone call, then user press a number from telephone, i must recive the number based on that i replay to that phone ( as a voice data),
Guide me to develop this project
ReplyI Need Your Help
Posted by Legacy on 07/19/2001 12:00amOriginally posted by: Md Elias
I wants dialup with serialport communication source code.We wants to check 64kbps modem with rs-232 communication.First we have to dial with modem and after conntection is establised have send some data through same comport 1 and receive back the data.We have some problem with this testing.pls try to help
ReplyLoading, Please Wait ...