Weird character in COM port list when compiled in Vista
-
:^)Can anyone shed some light. I have rebuilt my application after installing Vista Premuim and downloading the latest VC++ Express edition (version 8.0.50727.867 ( vista.050727-8600) .Net Framework version 2.0.50727) using the following code sample and I am getting some weird results to the port list which I don't see when running the same code that was compiled in windows XP with VC++Express (Don't know what version I had since my drive crashed - Was downloaded in 2006) This is the code try { // Get a list of serial port names. TRK_PORTNAME_cbox->Items->Clear(); TRK_PORTNAME_cbox->Items->AddRange(TRK_Port->GetPortNames()); } catch (Win32Exception^ ex) { MessageBox::Show(ex->Message); } At this point TRK_PORTNAME_cbox->Items[0-2] contains: "COM3" "COM5鮤" "COM4" I don't know why it's finding Com3 and 5 since I only have a USB to serial adapter at COM4. THat weird character after COM5 doesn't appear when I run my old build in Vista. Help!! LarryD
-
:^)Can anyone shed some light. I have rebuilt my application after installing Vista Premuim and downloading the latest VC++ Express edition (version 8.0.50727.867 ( vista.050727-8600) .Net Framework version 2.0.50727) using the following code sample and I am getting some weird results to the port list which I don't see when running the same code that was compiled in windows XP with VC++Express (Don't know what version I had since my drive crashed - Was downloaded in 2006) This is the code try { // Get a list of serial port names. TRK_PORTNAME_cbox->Items->Clear(); TRK_PORTNAME_cbox->Items->AddRange(TRK_Port->GetPortNames()); } catch (Win32Exception^ ex) { MessageBox::Show(ex->Message); } At this point TRK_PORTNAME_cbox->Items[0-2] contains: "COM3" "COM5鮤" "COM4" I don't know why it's finding Com3 and 5 since I only have a USB to serial adapter at COM4. THat weird character after COM5 doesn't appear when I run my old build in Vista. Help!! LarryD
You can check that list in other places: - a terminal emulator (such as HyperTerminal) should present it to you - the Device Manager (right click "My Computer" if that is still around, then follow the word "Hardware"...) should enumerate all your hardware, so you could find serial ports under a whole range of entries, such as: Ports, USB, and some vendor-specific groups if any. If none of the above show COM3 and COM5, you can safely conclude they dont exist, and your app+VS+.NET is wrong; if they do show up, you are in for a Vista drivers adventure I guess. :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }