Simon:

By the time I figured out the 30-th or was it 40-th value to put into a 
struct member to use this routine,  I decided to stick with what we 
have.  I know you have a wicked sense of humor but I missed the humor 
here altogether  :-P .  We can modify what we have on the try/catch 
approach to parse the error to tell if it is nonexistent or in use and 
the somehow color or grey or whatever the ones that are in use.

Bob




Simon Brown (HB9DRV) wrote:

>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
>
>  
>


-- 
Robert W. McGwier, Ph.D.
Center for Communications Research
805 Bunn Drive
Princeton, NJ 08540
(609)-924-4600
(This sig required by my employer)


_______________________________________________
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