Print Page | Close Window

Purpose of afx_msg keyword?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Visual C++ MFC Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=14988
Printed Date: 14 May 2025 at 9:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Purpose of afx_msg keyword?
Posted By: znakeeye
Subject: Purpose of afx_msg keyword?
Date Posted: 17 August 2009 at 10:48am
What's the purpose of afx_msg?
 
E.g.
afx_msg void OnPaint();
 
Is it merely there to make it easier for VC++ to add message-handlers? Is it even needed in VC++ 2008?


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: ABuenger
Date Posted: 17 August 2009 at 11:19am
ClassWizard requires that you use the afx_msg keyword in your message map handler declarations.

http://msdn.microsoft.com/en-us/library/0812b0wa%28VS.80%29.aspx - http://msdn.microsoft.com/en-us/library/0812b0wa(VS.80).aspx



-------------
Codejock support


Posted By: znakeeye
Date Posted: 18 August 2009 at 6:59am
Thanks! I've been looking for that article! :D
 
Finally I got the answer to why command-handlers are not simply virtual member functions:
"Due to the large number of messages involved, providing a separate virtual function for each Windows message results in a prohibitively large vtable."


-------------
PokerMemento - http://www.pokermemento.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net