Topic: DetectPorts in the sample app - only virtual ports?
|By: NewGuest||Posted on: Jul 28 2016 at 10:59:19 AM|
|Because of ongoing problems with MSCOMM32 I look for a replacement.|
Seems I've found one...
In the VB6 sample app, there is the Sub DetectPorts.
This works fine in here.
A coworker told me, this is not the case on his side.
He says only virtual ports are listed.
I can't retrace it, I just have no single PC with real serial ports.
What is the truth?
|By: Support||Posted on: Jul 28 2016 at 11:55:08 AM|
|With MSComm32 the only way to detect available ports is to actually try to open them and handle the success or failure.|
That method should still work with this SComm32 component as well so any code written for MSComm32 should also work for Scomm32.
The functionality you're referring to is the .CommName property which can additionally retrieve the full 'friendly' name of the port rather than just the number. The property returns an empty string if the port does not exist.
The CommName property does not look at physical or virtual hardware so can't tell the difference. It just makes calls into the Windows setupapi to get names of devices so I can't think of any reason why it would work with virtual ports but not with the ports physically present on the PC Mainboard.
If your co-worker looks in his Windows Device manager what names does he see?
|By: NewGuest||Posted on: Jul 29 2016 at 08:31:52 AM|
|Nothing in the ports category!|
The port in question is a modem:
HDAUDIO Soft Data Fax Modem with SmartCP
Device type: Modems
Location: Location 0 (Internal High Definition Audio Bus)
In it's properties, in the Modem tab, the port is listed as COM3.
There is also a Maximum Port Speed selection, 115200 is set.
This obviously existing (?) port is not listed in the ports category.
This must be the reason why DetectPorts and the underlying logic can't find it.
|By: Guest||Posted on: Jul 29 2016 at 01:32:11 PM|
|Ignoring .Portname property for a moment. What happens if you try to open com3 and use it? Does it open? |
|By: NewGuest||Posted on: Jul 29 2016 at 03:29:15 PM|
|The port opens ok, at least with MSCOMM32.|
For SCOMM32, I have to ask.
Will come back when I know.
|By: Guest||Posted on: Jul 29 2016 at 07:57:56 PM|
|The modem sounds like an integrated single chip modem so does not include a physical rs232 serial port. In that case the name "com3" is mapped by the device driver to a logical file name rather than a virtual serial port.|
Should still be accessible with scomm32 as "com3" because serial i/o and file i/o are basically the same.
|By: NewGuest||Posted on: Jul 31 2016 at 10:13:47 AM|
|This COM3 is accessible with SCOMM32.|
To detect the existence of the port, we need to use the trial&error method as with MSCOMM32.
No problem so far.
This 'problem' is solved then.
Thank you for the quick support.
Reply - add a comment to this topic.
You may enter letters, numbers and standard punctuation only. HTML and other scripts/tags will be rejected.