Click to See Complete Forum and Search --> : How to identify COM Ports Irrespective of Hardware we are using ?


September 27th, 1999, 02:41 AM
Hi,

I want to know how many COM Ports are available in the system.. And out of them how many of them are valid COM Ports.. I could achieve to locate how many COM Ports are available by searching in the Registry for this path (hkey_local_machine/hardware/devicemap/serialcomm). This is valid in some hardware and the same path is not available in some other machines. And I could check the validity of the COM Port using the MsComm Control by which I can know whether the Port is valid port or not..

Now I want my solution to be generic.. Irrespective of the hardware we are using it should display me all the COM Ports which I am using including COM1 / COM2 / COM3 / COM4 upto COM8 if present.

I have used the following Registry API's in solving this problem
RegOpenKeyEx , RegQueryValueEx , RegEnumValue , RegEnumKey .. and some other
constants


Please let me know some way out to solve this problem.

Regards

Prasad