BBC BASIC for Windows
« Identifying a particular COM port »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:15pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Identifying a particular COM port  (Read 1829 times)
movr0r0
New Member
Image


member is offline

Avatar




PM


Posts: 7
xx Re: Identifying a particular COM port
« Reply #3 on: Dec 28th, 2014, 10:40am »

Hi Richard,

This Win32_SerialPort WMI class support with your code example above works well to enumerate "COMx" ports and getting their actual number 'x', using the "DeviceID" Property.
However, although everything is fine with Win7 (and I guess 8), when using this method on WinXP, enumeration stops at the first available port, without error.
On-line MSDN doc appears to relate only to Vista onwards, and obviously there is no more hint about description or changes of the XP version of this class.

Any idea on how to make it fully work on XP too?

Thanks,
R.
User IP Logged

rtr2
Guest
xx Re: Identifying a particular COM port
« Reply #4 on: Dec 28th, 2014, 12:06pm »

on Dec 28th, 2014, 10:40am, movr0r0 wrote:
Any idea on how to make it fully work on XP too?

I fear that if you can't make the WMI method work you will have to fall back to reading the Registry. Do you really need to support XP, given its age and status?

Richard.
User IP Logged

movr0r0
New Member
Image


member is offline

Avatar




PM


Posts: 7
xx Re: Identifying a particular COM port
« Reply #5 on: Dec 28th, 2014, 3:32pm »

Many thanks for your quick reply, Richard!

Supporting XP would be nice; I still have a couple of old laptops -- with real serial ports smiley -- that prefer this aging version...

What's the best way to get Windows version from within bb4w?

R.
User IP Logged

rtr2
Guest
xx Re: Identifying a particular COM port
« Reply #6 on: Dec 28th, 2014, 5:04pm »

on Dec 28th, 2014, 3:32pm, movr0r0 wrote:
What's the best way to get Windows version from within bb4w?

http://www.bbcbasic.co.uk/bbcwin/manual/bbcwine.html#winver

Richard.
User IP Logged

movr0r0
New Member
Image


member is offline

Avatar




PM


Posts: 7
xx Re: Identifying a particular COM port
« Reply #7 on: Dec 28th, 2014, 5:45pm »

Many thanks again for your great help, Richard.

R.
User IP Logged

movr0r0
New Member
Image


member is offline

Avatar




PM


Posts: 7
xx Re: Identifying a particular COM port
« Reply #8 on: Jan 20th, 2015, 09:59am »

Hi!

It looks like Windows Win32_SerialPort WMI class miserably fails to detect and list most of virtual serial ports (e.g. over an Ethernet link, such as Tibbo), and more annoyingly USB-to-serial adapters, such as ATEN or Prolific.

Any idea about which method could be used to let Windows (and BBCBasic) nicely list what is reported in the "COM ports and LPT" section of the Device Manager?

Thanks,
R.
User IP Logged

rtr2
Guest
xx Re: Identifying a particular COM port
« Reply #9 on: Jan 20th, 2015, 12:46pm »

on Jan 20th, 2015, 09:59am, movr0r0 wrote:
It looks like Windows Win32_SerialPort WMI class miserably fails to detect and list most of virtual serial ports

I don't think you should blame Windows, it's more likely that some 'virtual' serial ports fail to follow the rules when they install themselves. After all, you can pretty much guarantee that all serial ports on a modern PC are 'virtual' so it would be daft if WMI never worked.

Quote:
Any idea about which method could be used to let Windows (and BBCBasic) nicely list what is reported in the "COM ports and LPT" section of the Device Manager?

I answered that before: "I fear that if you can't make the WMI method work you will have to fall back to reading the Registry". But you would be entirely justified in using WMI and simply saying that your software is incompatible with 'non-conforming' virtual port drivers.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls