Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comport - Opening port when not called Com1, Com2 etc

Status
Not open for further replies.

KNMn

Programmer
Jun 29, 2006
6
0
0
AU
I am using the windows CreateFile() function to open and communicate to modems via a comport, but have come across some modems (especially internal modems) which present their port as a custom name in place of the usual Com1, Com2.. etc, as viewed in Hyperterminal.

LPCTSTR lpFileName;

lpFileName = "COM1";

HANDLE hComm = CreateFile( lpFileName,
GENERIC_READ | GENERIC_WRITE,
0,
0,
CREATE_NEW,
0,
0);

I would be very greatful if someone could suggest a means of programatically reading the modem port designation for use in this (or other) functions to access the comport.
 
Thanks for that James. Its given me some clues for investigation. Thanks!
I wonder if I can perhaps use RAS to enumerate the ports, and determine the port names to then use in the old CreateFile() function!?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top