• AFX_MSG是什么意思


     afx_msg 是一个宏 标识是消息映射函数,增加可读性。

           在 MSDN里是这样定义的:

                 AFX_MSG

                  remarks

                  ClassWizard   and   AppWizard   insert   specially   formatted   comment   delimiters   in   your  

                  source   code   files   to   mark   the    places   in   your   files   that   ClassWizard   can   write   to.  

                  AFX_MSG   is   used   to   mark   the   beginning   and   end   of   ClassWizard   entries   in   your

                 header   file   (.H)   related   to   message   maps:

                //{{AFX_MSG(classname)
                 ...
                //}}AFX_MSG

     

    在CSDN 中也有人这样解释:

    afx_msg是给MFC   classwiard作的标记,表示这个.cpp文件中classwiard应该插入代码的地方。     如果把{{//afx_msg   ......等类似的符号删了,classwizard   就会报错。
    也就是说,如果你把那些东西删了,你就用不了classwizard,而只能手工输入代码了


    afx_msg   什么都没定义,是为以后扩充保留的。
    它的定义如下:(具体在哪个文件里,我忘记了)
    #define   afx_msg
    可以看出来它实际上是一个空定义!

    这些消息处理函数的说明一般都有“afx_msg”的前缀,用于把处理函数与其他的窗口成员函数区分开来,这些函数都是通过消息映射实现的。比如,消息 WM_CHAR 的处理函数在 CWnd 中声明成:

    afx_msg void OnChar();

  • 相关阅读:
    加载db2的驱动类,连接数据库URL下的特定schema并插入数据
    vi修改编辑文件提示Write Error!(File System full?)研究与解决
    java实现一次性压缩多个文件
    java转义字符
    统计数字问题0
    系统开关机
    统计数字问题1
    算法的力量
    半数集0
    wBox是一款轻量级的弹出窗口插件
  • 原文地址:https://www.cnblogs.com/flyingspark/p/2397559.html
Copyright © 2020-2023  润新知