GenericWndClass::Register Windows CE issue
Brought to you by:
nenadstefanovic
GenericWndClass::Register function in atlapp.h uses the WNDCLASSEX structure which is unavailable in Windows Ce/Mobile. The following change helped me address the issue
inline ATOM Register() {
WNDCLASS wc = { sizeof(WNDCLASS) };
WNDCLASSEX wc = { sizeof(WNDCLASSEX) };
wc.lpfnWndProc = ::DefWindowProc; wc.hInstance = ModuleHelper::GetModuleInstance(); wc.hCursor = ::LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wc.lpszClassName = GetName(); ATOM atom = 0;
atom = ::RegisterClass(&wc);
atom = ::RegisterClassEx(&wc);
ATLASSERT(atom != 0); return atom; }
Anonymous
Forgot to mention I used the latest release WTL90_4140_Final.zip
Simple and stupid omission, sorry. It will be fixed.
Thank you.
Fixed
atlapp.h, revision 604
error in line:
WNDCLASS wc = { sizeof(WNDCLASS) };
==
wc.style = sizeof(WNDCLASS);
Thanks!
Fixed - atlapp.h, rev. 605