Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => C++ programming (SDK style) => Topic started by: James C. Fuller on October 29, 2013, 06:09:51 PM

Title: HANDLE_MSG macros
Post by: James C. Fuller on October 29, 2013, 06:09:51 PM
Patrice or any c++ coders,
  Have you used the HANDLE_MSG macros in windowsx.h
Reasons for or  against.

James
Title: Re: HANDLE_MSG macros
Post by: Patrice Terrier on October 29, 2013, 06:34:19 PM
No, because i have to pre-process or post-process all of the messages in WinLIFT.

But perhaps you may find this link useful to learn how to use the HANDLE_MSG macros. (http://www.dreamincode.net/forums/topic/286954-using-windowsxh-for-better-code-organization-and-message-cracking/)
Title: Re: HANDLE_MSG macros
Post by: James C. Fuller on October 29, 2013, 06:54:06 PM

Thanks Patrice for the link.
I know how to use them and  even have a little utility that formats the macros and function calls and copies them to the clipboard.

http://www.codeproject.com/Articles/4948/Message-Cracker-Wizard-for-Win32-SDK-Developers

I just haven't seen much code that used them and was wondering if there was a reason?

James
Title: Re: HANDLE_MSG macros
Post by: Mike Stefanik on October 29, 2013, 07:03:33 PM
Message crackers are useful for C programs just to help with readability, but for C++ most folks don't deal with that kind of low-level implementation. They tend to use the CWindow derived classes. I would bet that most new Windows programmers these days who code in C++ have no idea exactly how messages are dispatched or even what a message pump is. That stuff is mostly hidden away by MFC and ATL.
Title: Re: HANDLE_MSG macros
Post by: Patrice Terrier on October 29, 2013, 07:09:22 PM
James--

One of the reason i don't use it, is because of all the cut and paste i have to do between the different languages i am using, thus forcing me to use only the syntax common to all of them  :(
Title: Re: HANDLE_MSG macros
Post by: James C. Fuller on October 29, 2013, 07:49:45 PM
Good point Mike.
My c interest began primarily with BCX and evolved to c++ with my several forks. While I have seen CWindow bantered about I have no clue...
At this point I am more interested in learning C++11 and the STL. All my work is done with my bc9Adp and translated code compiled with batch files.
I did a quick foray into Win32++: http://win32-framework.sourceforge.net/index.htm a couple years ago but got sidetracked and besides it was too much typing. I discovered that using a class with a resource dialog I have an sdk window instead of a dialog.

James