Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Sebastian Leopold
|
Nov 6, 2010 - 12:35 AM
|
Hello, I have a simple MFC Project with a child view. The Child view is handling the WS_INPUT Data for RAW INPUT. When I include the Prof-UIS.h inside my StdAfx.h I got a compilation Error.
To reproduce the Issue: - Create a simple MFC Project with the Application Wizard. - Add the following Code to the WndProc Function of the ChildView.
switch(message) { case WM_INPUT: { UINT dwSize;
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &dwSize, sizeof(RAWINPUTHEADER));
LPBYTE lpb = new BYTE[dwSize]; if(lpb == NULL) return 0; } break; }
- Compile. You can see the Application running. - Now include the Prof-UIS.h inside the StdAfx.h - Compile again and you’ll get a strange error.
What can I do to prevent this.
|
|
Technical Support
|
Nov 9, 2010 - 1:51 AM
|
We provided you with the solution we found using Visual Studio 2008. It can be different on other Visual Studio versions.
|
|
Sebastian Leopold
|
Nov 7, 2010 - 1:13 AM
|
That solution doesn’t seem to work...
Instead I have found a work around but I don’t know what happens if I do that in Prof-UIS. In the File ExtMfcDef from Prof-UIS there is the following code block:
#if _MFC_VER >= 0x900 #ifndef HRAWINPUT #define HRAWINPUT DWORD #endif struct tagMENUGETOBJECTINFO; typedef tagMENUGETOBJECTINFO MENUGETOBJECTINFO; typedef tagMENUGETOBJECTINFO * PMENUGETOBJECTINFO; #endif
If I modify that to
#if _MFC_VER >= 0x900 /* #ifndef HRAWINPUT #define HRAWINPUT DWORD #endif */ struct tagMENUGETOBJECTINFO; typedef tagMENUGETOBJECTINFO MENUGETOBJECTINFO; typedef tagMENUGETOBJECTINFO * PMENUGETOBJECTINFO; #endif
all seems to work....
|
|
Technical Support
|
Nov 6, 2010 - 10:14 AM
|
Please add the _WIN32_WINNT=0x0700 definition to the preprocessor settings of your project. Then please add the following lines of code at the top of the StdAfx.h file before including any other headers. #if (_WIN32_WINNT >= 0x0501)
#define CCM_SETWINDOWTHEME (CCM_FIRST + 0xb)
#define CCM_DPISCALE (CCM_FIRST + 0xc) // wParam == Awareness
#endif
Thant’s all. Prof-UIS is compiled with _WIN32_WINNT=0x0400 because we support compatibility with old Windows versions. That’s why you faced some difficulties with new Win32 API declarations.
|
|