Menu

#269 GenericWndClass::Register Windows CE issue

v1.0 (example)
closed-fixed
None
5
2015-05-02
2015-02-04
lazzycoderr
No

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()
{

ifdef UNDER_CE

    WNDCLASS wc = { sizeof(WNDCLASS) };

else

    WNDCLASSEX wc = { sizeof(WNDCLASSEX) };

endif

    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;

ifdef UNDER_CE

    atom = ::RegisterClass(&wc);

else

    atom = ::RegisterClassEx(&wc);

endif

    ATLASSERT(atom != 0);
    return atom;
}
1 Attachments

Discussion

  • lazzycoderr

    lazzycoderr - 2015-02-04

    Forgot to mention I used the latest release WTL90_4140_Final.zip

     
  • Nenad Stefanovic

    • assigned_to: Nenad Stefanovic
     
  • Nenad Stefanovic

    Simple and stupid omission, sorry. It will be fixed.

     
  • lazzycoderr

    lazzycoderr - 2015-02-04

    Thank you.

     
  • Nenad Stefanovic

    Fixed

    atlapp.h, revision 604

     
  • Nenad Stefanovic

    • status: open --> closed-fixed
     
  • Anonymous

    Anonymous - 2015-05-01

    error in line:
    WNDCLASS wc = { sizeof(WNDCLASS) };
    ==
    wc.style = sizeof(WNDCLASS);

     
  • Nenad Stefanovic

    Thanks!

    Fixed - atlapp.h, rev. 605

     

Anonymous
Anonymous

Add attachments
Cancel