Solved

RegisterDeviceNotification declaration with MFC headers

Posted on 2003-10-28
8
868 Views
Last Modified: 2013-12-03
I'm trying to use RegisterDeviceNotification in a test mfc dialog for proof of concept of something before I turn it into a sevice.  However, I cannot get the function declaration to work that is in winuser.h  Either by letting mfc includes get or by explicity declaring it.

Is there some define that has to be set for those things to be included in the header correctly?  Like how in VS6, you have to redeclare WINVER to be 0x0500 for the structure typedefs that you use with RegisterDeviceNotification to be included correctly in dbt.h
0
Comment
Question by:_corey_
  • 5
  • 2
8 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
ID: 9639501
0
 
LVL 8

Author Comment

by:_corey_
ID: 9639983
Actually, in the question I point out that I use that as an example and wanted to know if there was another requirement because I refuses to find it.

Also, you know how you can specify specific usb device GUID's?  Well they are defined in some ddk headers which I cannot get a hold of right now.  Could anyone give me these GUIDs for usb and/or joystick type devices?
0
 
LVL 8

Author Comment

by:_corey_
ID: 9640022
Oh, my bad, late night :)   But still the GUID id question?  I'll throw some more points for anyone with that data.  I cannot get a ddk download anywhere or order started.
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 9641189
The DDK is not for download anymore.
There is also no GUID for mouse or joystick. Only for individual devices of a single manufacturer.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Expert Comment

by:robert_marquardt
ID: 9641192
What do you want to achieve?
0
 
LVL 8

Author Comment

by:_corey_
ID: 9643035
Well, that generic usb GUID would do for now then.

I can always check to see if there was actually a device of the type I want plugged in, I just thought there might be sub-category predefined GUIDs but I never found any myself.  But, I also don't have that header.

Yea, the DDK isn't for download anymore, and the page to get it was screwed up, so I was looking for some declarations to use.
0
 
LVL 8

Author Comment

by:_corey_
ID: 9645138
Defining that _WIN32_WINNT seems correct but doesn't have any effect that I can tell, perhaps I have some other problem.

If anyone can give me usbioctl or some file with those guid definitions, I'lll then split the points.
0
 
LVL 8

Author Comment

by:_corey_
ID: 9645672
For those looking it is _WIN32_WINNT not WIN32_WINNT but it does work once you setup the defines correctly (and don't forget a rebuild all).

The order page is finally working so I just ordered the new ddk so I can get the headers/libs correctly instead of hacking it up.  Thanks guys.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now