problem in device notification  
Author Message
dinesh1234





PostPosted: Visual C++ Language, problem in device notification Top

hai all,

I had written a application that had to detect the usb device vendor name. I got the notification for device arrival and removal. On arrival i am enumerating the device using setupdi... function

It gives me the following info USB MASS STORAGE for SPDRP_DEVICEDESC.

I am getting 2 notification for one arrival and removal one with

DBT_DEVTYP_DEVICEINTERFACE and then with DBT_DEVTYP_VOLUME

any idea kindly suggest...

the details are given below..

switch(wParam)

{

case DBT_DEVICEARRIVAL:

{

PDEV_BROADCAST_HDR shdr = (PDEV_BROADCAST_HDR) lParam;

switch( shdr->dbch_devicetype )

{

case DBT_DEVTYP_DEVICEINTERFACE:

{

PDEV_BROADCAST_DEVICEINTERFACE sDevInt = (PDEV_BROADCAST_DEVICEINTERFACE)lParam;

CheckDevice(sDevInt);

break;

}

case DBT_DEVTYP_VOLUME:

{

MessageBox("Volume Message");

break;

}

default:

MessageBox("default Message");

}

//MessageBox("printer arrived");

break;

}

case DBT_DEVICEQUERYREMOVE:

return BROADCAST_QUERY_DENY;

case DBT_DEVICEREMOVEPENDING:

case DBT_DEVICEREMOVECOMPLETE:

MessageBox("Printer Removed");

break;

}

return true;




Visual C++7  
 
 
einaros





PostPosted: Visual C++ Language, problem in device notification Top

This question is not within the scope of the C++ language forum. See http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=789657&SiteID=1 for more information about the types of issues we deal with here.

Many borderline questions are answered here, but in this case you really should take it to the newsgroups at http://msdn.microsoft.com/newsgroups. There are kernel specific newsgroups there, where people are far more likely to give you the proper insight.

Thanks!

(OTP)