USB复合设备“准备使用".事件? [英] USB composite device "ready to use" event?

查看:105
本文介绍了USB复合设备“准备使用".事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在编写一个应用程序,该应用程序需要在连接到USB端口后立即与USB复合设备进行通信.
我正在使用WM_DEVICECHANGE和DBT_DEVICEARRIVAL来获取当设备已连接时会收到通知,此后我立即开始与设备通信.
现在,如果设备是第一次连接,我会遇到麻烦. Windows正在安装复合设备的每个接口(有4个接口-音频,指向,音量控制,用户控制),这需要一些时间.但是,Windows在其安装过程开始时已经发送了DBT_DEVICEARRIVAL消息.因此我得到了消息并开始进行通信,但是我遇到了读写错误,直到Windows完成界面的安装为止.

我想通过不处理DBT_DEVICEARRIVAL消息来解决此问题,而是处理其他一些消息,当Windows已完成所有设备接口的安装时(->当您的设备准备就绪,可以使用"消息框出现时,将发送此消息).

是否有这样的消息?

btw:在xp,vista,7上是相同的.

请注意,
Robert

Hi,

i am writing an application which needs to communicate with a USB composite device as soon as it is connected to the USB port.
I am using WM_DEVICECHANGE and DBT_DEVICEARRIVAL to get notified when the device was connected, and immediately after that i start communicating to the device.
Now i have troubles, if the device was connected for the very first time. Windows is installing each interface of the composite device (there are 4interfaces - audio, pointing, volume control, comsumer control), which takes some time. however, windows sends the DBT_DEVICEARRIVAL message already at the beginning of its installation process. so i get the message and start communicating, however i get read and write errors, until windows has finished installing the interfaces.

i want to solve this problem by not handling the DBT_DEVICEARRIVAL message, but some other message, which is sent, when windows has finished installing all device interfaces (-> when the "your device is ready to use" messagebox appears).

Is there such a message?

btw: this is the same on xp, vista, 7.

Regards,
Robert

推荐答案

那里没有这样的消息.
There is no such message.
但是我认为实际的问题出在您尝试与设备进行通信的方式上.
But I believe the actual problem is in the way you're trying to communicate with the device.


这篇关于USB复合设备“准备使用".事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆