EDN Admin
Well-known member
Hi All,
I have an application which programs a microchip over USB. When the USB device is connected to the PC, about 50% of the time it enumerates properly and the rest of the time Windows pops up a "USB device not recognized" message.
Currently, I override WndProc and handle the WM_DEVICECHANGE message to determine when this USB device is attached (also using SetupDixxx functions to extract extra device information). The problem comes when the device fails to enumerate - ideally, Id
like to be able to trap the event when a device does not enumerate properly.
Is this at all possible?
What Im seeing so far is that in WndProc, when a device fails to enumerate I get a DBT_DEVNODES_CHANGED event yet no information which comes with this event informs me of an unsuccessful connection.
Ive considered implementing some kind of timeout which expires if a device hasnt been seen for a couple of seconds, however as this application is to be run on various different hardware setups, the time taken for enumeration can vary greatly.
Any suggestions? Unfortunately, it isnt possible to fix the USB device so that it enumerates successfully every time.
This post may well be in the wrong forum too, would there be a better forum for this?
Thanks,
Kev
View the full article
I have an application which programs a microchip over USB. When the USB device is connected to the PC, about 50% of the time it enumerates properly and the rest of the time Windows pops up a "USB device not recognized" message.
Currently, I override WndProc and handle the WM_DEVICECHANGE message to determine when this USB device is attached (also using SetupDixxx functions to extract extra device information). The problem comes when the device fails to enumerate - ideally, Id
like to be able to trap the event when a device does not enumerate properly.
Is this at all possible?
What Im seeing so far is that in WndProc, when a device fails to enumerate I get a DBT_DEVNODES_CHANGED event yet no information which comes with this event informs me of an unsuccessful connection.
Ive considered implementing some kind of timeout which expires if a device hasnt been seen for a couple of seconds, however as this application is to be run on various different hardware setups, the time taken for enumeration can vary greatly.
Any suggestions? Unfortunately, it isnt possible to fix the USB device so that it enumerates successfully every time.
This post may well be in the wrong forum too, would there be a better forum for this?
Thanks,
Kev
View the full article