Home All Groups Group Topic Archive Search About

System.IO.Ports.SerialPort.GetPortNames return wrog names above CO

Author
27 Feb 2006 3:30 PM
SamB
Hello all!

MY CASE:

I'm using VB.net 2005 express on a Dell Laptop with an USB Bluetooth key.
I'm trying to send data to a pocketPC.
COM numbers changes each time i've got a new bluetooh "connection" with my
PDA.
I need 2 ports, one for ingoing data, one for outgoing data (that's how
serial port profile in bluetooth is made)
Sometime it's COM 5 and 6, some time 11 and 12.

I'm using this code to get the port names, display them in a combobox to let
the user choosing the right one:
in the Form load event:
            Dim ports As String() = System.IO.Ports.SerialPort.GetPortNames
            Dim port As String
            For Each port In ports
                PortIn_List.Add(port)
                PortOut_List.Add(port)
            Next port
'CMB_xxxx are combobox
           CMB_PortNumIn.DataSource = PortIn_List
           CMB_PortNumOut.DataSource = PortOut_List

In the OK button:
SerialPortIn.PortName = CMB_PortNumIn.Text
SerialPortOut.PortName = CMB_PortNumOut.Text

MY PROBLEM:

with all COM numbers under 10, no problem, but with COM number above 9 (11
and 12 in my case), getportnames return "COM11c" and "COM12c"!
Is anybody can "duplicate" this error? Is it a bug?

Author
27 Feb 2006 7:06 PM
Dick Grier
Hi Sam,

>>
"COM11c" and "COM12c"!
<<

When you use these values to set the port, do they work, or is there an
error?  I don't have any BT hardware to test right now, but I don't see this
with some other virtual serial port drivers for hardware that I do have
installed.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004.
See www.hardandsoftware.net for details and contact information.
Author
27 Feb 2006 8:27 PM
SamB
No, it doesn't work with those names. I have to write "COM11" and "COM12" in
the comboboxes!
Are you able to test this function with a high numbuer next to COM?

Show quoteHide quote
"Dick Grier" wrote:

> Hi Sam,
>
> >>
> "COM11c" and "COM12c"!
> <<
>
> When you use these values to set the port, do they work, or is there an
> error?  I don't have any BT hardware to test right now, but I don't see this
> with some other virtual serial port drivers for hardware that I do have
> installed.
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004.
> See www.hardandsoftware.net for details and contact information.
>
>
>
Author
28 Feb 2006 7:40 AM
SamB
Hello Dick, i have download VSterm from your pages and the problem is the same!
I can email you a capture of my screen with "COM14c" and "COM13c" in your
settings form of VSTerm! When I select them, no problem, but when I try to
open it, nothing happen, and the port open item in the menu is not checked!

It seems that when I move my usb dongle from Usb port to Usb Hub, COM number
change, that's why today, number are 13 and 14.
My Usb dongle is a "Top suxess" one, The chipset came from CSR, the driver
from Microsoft, V 5.1.2600.2180

Show quoteHide quote
"Dick Grier" wrote:

> Hi Sam,
>
> >>
> "COM11c" and "COM12c"!
> <<
>
> When you use these values to set the port, do they work, or is there an
> error?  I don't have any BT hardware to test right now, but I don't see this
> with some other virtual serial port drivers for hardware that I do have
> installed.
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004.
> See www.hardandsoftware.net for details and contact information.
>
>
>