Click here to Skip to main content
15,885,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: UrldownloadToFile Pin
ThatsAlok14-Apr-09 23:16
ThatsAlok14-Apr-09 23:16 
QuestionRe: UrldownloadToFile Pin
David Crow15-Apr-09 3:32
David Crow15-Apr-09 3:32 
QuestionCoonected USB Device Pin
Davitor14-Apr-09 19:32
Davitor14-Apr-09 19:32 
AnswerRe: Coonected USB Device Pin
Xing Chen14-Apr-09 19:59
Xing Chen14-Apr-09 19:59 
GeneralRe: Coonected USB Device Pin
Davitor14-Apr-09 20:43
Davitor14-Apr-09 20:43 
GeneralRe: Coonected USB Device Pin
Xing Chen14-Apr-09 21:34
Xing Chen14-Apr-09 21:34 
AnswerRe: Coonected USB Device Pin
Hamid_RT14-Apr-09 20:22
Hamid_RT14-Apr-09 20:22 
AnswerRe: Coonected USB Device Pin
Randor 14-Apr-09 23:12
professional Randor 14-Apr-09 23:12 
Your RegisterDeviceNotification[^] code is probably working correctly, however it will only detect changes while your application is running.

You failed to mention what type of USB device your application needs to enumerate. I will assume that you need all USB device types. You will essentially need to call SetupDiGetClassDevs[^] and pass the enumerator filter of "USB". Dont be frightened by the Windows Driver Kit references in the MSDN documentation. You will be able to use the SetupAPI without the DDK installed, although I believe you will need Platform SDK/Microsoft SDK.

The following link should be enough to get you started:
How to enumerate hardware devices by using SetupDi calls[^]

You should modify the Microsoft sample code to something like the following:

#pragma comment (lib,"Setupapi.lib")
hDevInfo = SetupDiGetClassDevs(NULL,"USB", 0,DIGCF_PRESENT | DIGCF_ALLCLASSES );


You can perform additional device filtering using the System-Supplied Device Setup Classes[^] or other Enumerator strings such as "USBSTOR".

Best Wishes,
-David Delaune
AnswerRe: Coonected USB Device Pin
Jonathan Davies15-Apr-09 1:22
Jonathan Davies15-Apr-09 1:22 
GeneralRe: Coonected USB Device Pin
Davitor15-Apr-09 1:40
Davitor15-Apr-09 1:40 
GeneralRe: Coonected USB Device Pin
Jonathan Davies15-Apr-09 1:53
Jonathan Davies15-Apr-09 1:53 
GeneralRe: Coonected USB Device Pin
Davitor15-Apr-09 2:04
Davitor15-Apr-09 2:04 
GeneralRe: Coonected USB Device Pin
Jonathan Davies15-Apr-09 2:53
Jonathan Davies15-Apr-09 2:53 
QuestionGIF showing problem Pin
subhabasu14-Apr-09 18:49
subhabasu14-Apr-09 18:49 
AnswerRe: GIF showing problem Pin
Xing Chen14-Apr-09 20:02
Xing Chen14-Apr-09 20:02 
GeneralRe: GIF showing problem Pin
subhabasu14-Apr-09 20:13
subhabasu14-Apr-09 20:13 
GeneralRe: GIF showing problem Pin
Hamid_RT14-Apr-09 20:26
Hamid_RT14-Apr-09 20:26 
GeneralRe: GIF showing problem Pin
ThatsAlok14-Apr-09 23:14
ThatsAlok14-Apr-09 23:14 
GeneralRe: GIF showing problem Pin
subhabasu14-Apr-09 20:28
subhabasu14-Apr-09 20:28 
GeneralRe: GIF showing problem Pin
Hamid_RT14-Apr-09 20:37
Hamid_RT14-Apr-09 20:37 
GeneralRe: GIF showing problem Pin
subhabasu14-Apr-09 20:51
subhabasu14-Apr-09 20:51 
GeneralRe: GIF showing problem Pin
Hamid_RT14-Apr-09 21:04
Hamid_RT14-Apr-09 21:04 
GeneralRe: GIF showing problem Pin
subhabasu14-Apr-09 22:17
subhabasu14-Apr-09 22:17 
GeneralRe: GIF showing problem Pin
Xing Chen14-Apr-09 21:48
Xing Chen14-Apr-09 21:48 
GeneralRe: GIF showing problem Pin
subhabasu14-Apr-09 23:49
subhabasu14-Apr-09 23:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.