COM error under Windows 10

Status
Not open for further replies.

mjohnm

Member
This post concerns serial communications with a Teensy 3.2 under Windows 10 - Teensy code is therefore not relevant and hence not provided.

Using VB6 and MSCOMM32.OCX to access Teensy 3.2 works well for me under Windows 7 and 8.x. However, under Windows 10 I get an 8020 device not available error. An internet search shows many other people have this issue (with devices other than the Teensy) but MS has not come up with a fix for MSCOMM32 and might be unable to reproduce the error. There has been some evidence that it is related to the serial driver being used. While installing my software my installer runs serial_install.exe. Could the issue be related to this? Has anyone else had this problem.

Switching to the third party SCOMM32.OCX fixes the 8020 bug but SCOMM32 is actually very different from MSCOMM32 under the hood - it badly breaks my VB6 code. If there is a simpler fix I want to go that route.

Yes, yes, I know I should switch to .net. It is on my to-do list but shutting down my business for a couple of months+ while I do a rather large port from VB6 to .net is not a viable solution. I'll do the port when business goes quiet or when I am forced to by customers. Fortunately for me it looks like Windows 10 is not popular with corporate IT people, but I am expecting an order from a Japanese customer who insists on Windows 10.

P.S. I really, really like the Teensy system (boards + Teensyduino under VisualMicro in VS.net). Since I switched from a lame 8-bit system, life has got a lot, lot easier. Sincere thanks to you Paul.
 
i use windows 10 & the driver that the teensy 3.6 uses is usbser.sys. when installing teensy duino to run teensy board under arduino that installer flags this driver as the one to use. i'm guessing that the applications you use require a different driver but i understood that the usbser.sys driver was a universal usb driver for windows 10.
 
I do a standard installation and MSCOMM32 is standard for VB6 to access the VCP driver - presumably that is usbser.sys because the Teensy serial_install.exe is executed by my installation software. Do you use VB6?
 
While installing my software my installer runs serial_install.exe. Could the issue be related to this?

Shortly after Microsoft released Windows 10, I updated serial_install.exe to detect if the Windows 10 usb serial INF is present. The check isn't specifically for the version of Windows. It actually looks for "usbser.inf" which Microsoft added in Windows 10. If found by SetupOpenInfFile(), my code read lines from the file with SetupGetLineText() and other setup API functions, looking for "ServiceBinary" equal to "usbser.sys", and "UsbSerial_AddReg" having "HKR,,EnumPropPages32,,MsPorts.dll,SerialPortPropPageProvider".

If the installer finds usbser.inf and it passes those tests, the installer does nothing. If it's not found, then WIN32 SetupCopyOEMInf() is used to add Teensy's INF. The idea was to automatically adapt if Microsoft were to ever release service packs for Windows 7 or 8, or should they device to remove their INF in future versions of Windows.

So if you are using a very old copy of the installer from before this update, then it may indeed be interfering with Windows 10.

But my guess is Microsoft changed stuff in USBSER.SYS. At the very least, they did fix this horrible bug. Odds are they made other changes too.
 
Paul, many thanks for the prompt reply and the background to the problem. I don't think I am using a very old copy of serial_install.exe on my Win10 machine, but will check. Are there alternatives to USBSER.SYS? If the problem is with USBSER.SYS does it mean that using an alternative to MSCOMM32 will not work? There must be a lot of poeple using the Teensy with VB6 and Win 10 - have you seen this problem before? Thanks again.
 
Are there alternatives to USBSER.SYS?

Well, there's RawHID. But whether it's even possible to access the HID API from VB6 is a good question. I can only point you to the C code I wrote. I have never personally used VB6, so I can't help with that part.

There must be a lot of poeple using the Teensy with VB6 and Win 10

You're the first person I've heard from in years using any version of VB on any version of Windows. If there are a lot more people, they're extremely stealthy.

have you seen this problem before?

No, this is the first I've heard of it.
 
SCOMM32.OCX fixed my issue with my old but functioning VB6 app - it now works flawlessly under Win10. This means I can delay a little longer the needed but time-expensive upgrade to .net. I point out that my app was developed when VB6 was the state-of-the-art and it has not needed much in the way of change since then so there has been no compelling reason to convert to .net. The only downside to continuing with VB6 is having to tolerate smart-arsed comments like the one above. ;)
 
The only downside to continuing with VB6 is having to tolerate smart-arsed comments like the one above. ;)

One of these smart-arses has helped a few conservative Swiss s/w companies to migrate their projects from VB6 to VB.NET more than 12 years ago. And 12 years are a very long time when it comes to software development... If I wanted to stay with my beginnings, I'd still write database applications in Paradox for MS-DOS 3.0...
 
Status
Not open for further replies.
Back
Top