There is no magic way to determine the list of COM ports configured on your 
system. Registry information is optional; the *only* sure way to determine 
the available COM ports without disrupting any running software is to use 
GetDefaultCommConfig() for COM1 to COM255. If GetDefaultCommConfig() returns 
non-zero then the COM port exists. GetDefaultCommConfig() is very fast.

I very strongly recommend that all COM ports are listed, even if they are 
currently held open by another program, otherwise you'll have some very 
confused users who will get frustrated because they can't see a COM port 
listed which they know they have on their computer.

If a COM port is held open by another program you'll get the 'Access Denied' 
error when opening the port - tell the user that the port is opened by 
another program, for example a PDA, GSM or whatever. This is preferable to 
not listing the COM port.

I haven't yet found a simple way of determining which program has a COM port 
open - I know it can be done though.

Simon Brown
---
http://blog.hb9drv.ch/

"There are two major products that came out of Berkeley: LSD and UNIX. We 
don't believe this to be a coincidence."
- Jeremy S. Anderson

----- Original Message ----- 
From: "Jim Lux" <[EMAIL PROTECTED]>
>
> there is also a Windows API call (exposed as a VB method) that returns
> available ports. There's an example in one of the serial port example
> programs on MSDN.
> 

_______________________________________________
FlexRadio mailing list
FlexRadio@flex-radio.biz
http://mail.flex-radio.biz/mailman/listinfo/flexradio_flex-radio.biz
Archive Link: http://mail.flex-radio.biz/pipermail/flexradio_flex-radio.biz/
FlexRadio Homepage: http://www.flex-radio.com

Reply via email to