Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > General Discussion
  New Posts New Posts RSS Feed - Purpose of afx_msg keyword?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Purpose of afx_msg keyword?

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Purpose of afx_msg keyword?
    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/
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post 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(VS.80).aspx

Codejock support
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.