CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Posts
    23

    Wmessages handler without mfc

    What is the equivalent of the construct
    ON_MESSAGE(WM_winmessage, EventHandler)

    in win32 C++? I mean without using mfcs

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Wmessages handler without mfc

    A winproc and a big switch statement.

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Wmessages handler without mfc

    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Aug 2009
    Posts
    23

    Re: Wmessages handler without mfc

    Perfect, exactly what I needed. Thank you both.

    Just another doubt: I have to create a wrapper class for a specific protocol, the purpose of this class is to be useful and easy to use for other people to integrate in their C++ projects.

    Is it better to design this class using mfcs or not? Not-mfc classes may be incorporate into mfc projects right?

  5. #5
    Join Date
    Aug 2009
    Posts
    23

    Re: Wmessages handler without mfc

    I was thinking at the "windows.h" thing.. Mfc have some problem with it and always give errors like "windows.h should not be included with mfcs", but if I do not use it what's the solution?

  6. #6
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Wmessages handler without mfc

    In an MFC application you should not include windows.h, because it's included from <afx.h>.

    Oh the other hand, non-MFC classes can of course be used in MFC applications, but MFC classes cannot be used in non-MFC applications.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured