Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > How do detect USB device arrive/remove in the HealthVault structur

Reply
Thread Tools Display Modes

How do detect USB device arrive/remove in the HealthVault structur

 
 
orson
Guest
Posts: n/a

 
      09-30-2010
Hi all,

I am using the FabrikamBloodPressure sample to add my own code, but there
are some function need to complete (e.g., OnDeviceArrival).

I had try and search some solution, but they don't work well or i can't find
the place to add in my code (e.g., RegisterDeviceNotification)

And where are some other discussion.
<a
href="http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/aa7d26ce-a044-401f-bdc4-42d1416e6839">Thread 1</a>

<a
href="http://social.msdn.microsoft.com/Forums/en/healthvault/thread/a14a1467-dcda-4300-91b9-b08b93286aa4">Thread 2</a>

Is there any other solution?

Thanks a lot.
 
Reply With Quote
 
 
 
 
Pavel A.
Guest
Posts: n/a

 
      09-30-2010
"orson" <> wrote in message
news:463D83B5-D7E3-48F9-B358-...
> Hi all,
>
> I am using the FabrikamBloodPressure sample to add my own code, but there
> are some function need to complete (e.g., OnDeviceArrival).
>
> I had try and search some solution, but they don't work well or i can't
> find
> the place to add in my code (e.g., RegisterDeviceNotification)
>
> And where are some other discussion.
> <a
> href="http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/aa7d26ce-a044-401f-bdc4-42d1416e6839">Thread
> 1</a>
>
> <a
> href="http://social.msdn.microsoft.com/Forums/en/healthvault/thread/a14a1467-dcda-4300-91b9-b08b93286aa4">Thread
> 2</a>
>
> Is there any other solution?
>
> Thanks a lot.


RegisterDeviceNotification() usually works well.
As to the place where it can be added, you usually do this just after you
get the
prerequisites - a window handle or service handle.
If you use a window handle, you get to have a message loop somewhere to
handle the WM_DEVICECHANGE.

Instead of using the arrival/removal notifications, you can find currently
attached devices using SetupDiGetClassDevs()

(but it still is recommended to detect the removal using notification, so
the app will promptly close the removed device's handle).

Regards,
-- pa


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Game Compatibility BCurrey Windows Vista Games 6 11-29-2007 08:11 PM
Going Golfing but not with Vista markbyrn Windows Vista Games 15 03-08-2007 10:59 AM
Cannot reuse old Device name in WMDC (Final) mlai ActiveSync 3 03-06-2007 08:15 AM
americas army stuttering under vista premium ernie Windows Vista Games 0 02-27-2007 10:20 PM
problem in dxdiag Peewee64 Windows Vista Games 0 02-14-2007 09:49 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59