afx_msg是一个空宏 #define'd in afxwin.h:
// Type modifier for message handlers
#ifndef afx_msg
#define afx_msg // intentional placeholder
#endif
Run Code Online (Sandbox Code Playgroud)
afx_msg无论是否使用 ,代码都将编译和工作,但按照惯例,它被用作指示该函数是消息处理程序的指示符,如果使用类向导,则需要使用TN006:消息映射:
ClassWizard 要求您在消息映射处理程序声明中使用 afx_msg 关键字。