AFX_MSG() block is intended to indicate Class Wizard that within this block
some overrided functions are declared. Take for example CDialog::OnOK(),
this is virtual function which you can override. When you do so, declaration
of this function will be visible in Class Wizard window - you can see it in
the list of overrides of your base class. Why bother? MFC as far as I know
is not portable, even if it was, AFX_MSG is preceeded by // which means
comment...
Regards,
Peter
"lyo" <liyongq...@hotmail.com> wrote in message
news:02c701c33c05$8cbdd520$a101...@phx.gbl...
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
"Joseph M. Newcomer" <newc...@flounder.com> wrote in message
news:c8gnfv8hecddf3n8m...@4ax.com...
From afxwin.h, line 128
#define afx_msg // intentional placeholder
That is clearly a macro definition. It defines a macro of no parameters with an empty
body. But it is beyond any shadow of a doubt a C/C++ macro.
joe
I suppose we have a little misunderstanding. I rather thought about
//{{AFX_MSG() - this is purely token and a token only, intended for non
C/C++, internal use and nothing else. Of course you're right about afx_msg,
but I don't thing Lyo was really asking about afx_msg, from what I
understood he meant //{{AFX_MSG() - that's the string Class Wizard puts into
a header somewhere near message maps stuff. If I'm mistaken, correct me.
Regards,
Peter
Why add a afx_msg do before my function.Before the
DECLARE_MESSAGE_MAP() MFC add a "afx_msg" before my
function.Help!
He did not ask about //{AFX_MSG}, but about afx_msg, lower case, in a position before the
function, which is where the macro is used.
joe
Joseph M. Newcomer [MVP]