[Qt-interest] winEvent
OS Prog
osprog at gmail.com
Sat Jul 4 19:55:33 CEST 2009
In that array (dbcc_name[]) I have (first few bytes):
0xDD40
0x0022
0x0000
0x0000
0x0000
0x0000
0x0000
0x0000
0x0001
0x0000
... maybe I'm doing something wrong...
>
>
> According to the MSDN, the dbcc_name property of
> PDEV_BROADCAST_DEVICEINTERFACE is an ANSI string when received via
> WM_DEVICECHANGE (as opposed to the service calls, where it's always a
> unicode string), maybe that's the issue?
>
> 2009/7/4 OS Prog <osprog at gmail.com>:
> > Hi,
> >
> > I try to find the attached USB PID and VID.
> >
> > bool MainWindow::winEvent ( MSG * message, long * result )
> >
> > {
> >
> > PDEV_BROADCAST_DEVICEINTERFACE pdbd;
> >
> > if (WM_DEVICECHANGE == message->message)
> >
> > {
> >
> > switch(message->wParam)
> >
> > {
> >
> > case DBT_DEVICEARRIVAL:
> >
> > qDebug("DBT_DEVICEARRIVAL");
> >
> > qDebug("lParam:%08X", message->lParam);
> >
> > if(message->lParam)
> >
> > {
> >
> > pdbd = (PDEV_BROADCAST_DEVICEINTERFACE)message->lParam;
> >
> > qDebug("%s", qPrintable(QString::fromUtf16((ushort*)(pdbd->dbcc_name))));
> >
> > }
> >
> > break;
> >
> > <snip>
> >
> > When I attach an USB Flash drive, I get only '?"' for dbcc_name. I expect
> > some string with PID and VID inside.
> >
> > What I'm doing wrong?
> >
> > It's Qt4.5 on Vista.
> >
> > Regards,
> >
> > Nikolay
> >
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> >
> >
>
>
> ------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> End of Qt-interest Digest, Vol 8, Issue 50
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090704/8b9cd5fd/attachment.html
More information about the Qt-interest-old
mailing list