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!

Finding list of available/active serial ports

Status
Not open for further replies.

jbs

Programmer
Feb 19, 2000
121
0
0
US
How do you determine which serial ports are installed and activated via the BIOS on a typical computer. For example, a computer could have two serial communication ports and only have one of them enabled via the BIOS setup menu. Another situation might be that a PCI circuit card has been installed on a computer with two additional serial ports that are activated however one of the serial ports on the motherboard is not enabled (i.e. COM1, COM3, and COM4 exist but not COM2).

I know how to communicate with a serial port via the CreateFile API which requires as an input parameter "COM1", "COM2", etc.

It seems 'inefficient' to create a loop that attempts to do a CreateFile to 'COM1', 'COM2', 'COM3'....and of course at what point do you stop.

Is there a device list that I can access to check each device to see if it is a serial communication device...and then grab it's identifier (i.e. COM1, COM2, .etc) which is then used via the CreateFile API to establish communiction with the port?

I'm sure accessing sometype of 'device list' will be helpful to me in the future and others that read this newgroup.

Thanks for the help./jbs


 
I forgot to mention:

As usual, the best implementation would be a W95 Retail thru WXP/2003 server compatible solution however any suggestions will be most appricatiated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top