Usbser.sys CDC Virtual COM Port
I have some issue regarding the use of the usbser.sys built in windows driver. I have implemented a USB CDC driver in some hardware that I am developing hoping not to have to change Win32 applicatins that currently talk to the device using an RS-232 COM Port. I have generated a .inf file for Windows XP and it installs the usbser.sys driver properly and it works. The Win32 apps can send and receive data over USB from the device as if it was connected to an RS-232 Com Port. The problem is that the device will not remain in the device manager when disconnected. It is of course very reasonable that when you unplug a USB device it is removed from the device manager, however, RS-232 ports are always available! This causes problems in the Win32 apps that are using the port as they have to be re-started (or they at least have to re-connect to the port) each time the device is reconnected to the PC.
Does anyone have any solutions?
Re: Usbser.sys CDC Virtual COM Port
I dont think there is anyway to change this. The Com1 and Com2 can also disappear by removal, especially on a laptop because they are in hw dock, or by disabling them in device manager.
Re: Usbser.sys CDC Virtual COM Port
Thank you for letting me know about it. I guess that I will have to implement Usb properly.
Re: Usbser.sys CDC Virtual COM Port
Hi All,
Just a note here that I had this problem. I got around it by scanning all available com ports a few times a second on a timer until the port I wanted came up and then opened it. Use the code below (VB sorry):-
Sub GetSerialPortNames()
' Show all available COM ports.
For Each sp As String In My.Computer.Ports.SerialPortNames
ListBox1.Items.Add(sp)
Next
End Sub
Regards