![]() ![]() |
|
计算机二级C宏智者的利刃,愚者的恶梦-中- | |
作者:佚名 文章来源:不详 点击数 更新时间:2008/4/18 13:57:36 文章录入:杜斌 责任编辑:杜斌 | |
|
|
on_command(idm_filenew, onfilenew) 它是如何实现的idm_about和onabout的关联的呢?这要用到几个宏。 #define declare_message_map() / private: / static const afx_msgmap_entry _messageentries[]; / protected: / static afx_data const afx_msgmap messagemap; / virtual const afx_msgmap* getmessagemap() const; / #define begin_message_map(theclass, baseclass) / const afx_msgmap* theclass::getmessagemap() const / { return &theclass::messagemap; } / afx_comdat afx_datadef const afx_msgmap theclass::messagemap = / { &baseclass::messagemap, &theclass::_messageentries[0] }; / afx_comdat const afx_msgmap_entry theclass::_messageentries[] = / { / #define on_command(id, memberfxn) / { wm_command, 0, (word)id, (word)id, afxsig_vv, (afx_pmsg)memberfxn }, #define end_message_map() / {0, 0, 0, 0, afxsig_end, (afx_pmsg)0 } / }; / #define declare_message_map() / private: / static const afx_msgmap_entry _messageentries[]; / protected: / static afx_data const afx_msgmap messagemap; / virtual const afx_msgmap* getmessagemap() const; / #define begin_message_map(theclass, baseclass) / const afx_msgmap* theclass::getmessagemap() const / { return &theclass::messagemap; } / afx_comdat afx_datadef const afx_msgmap theclass::messagemap = / { &baseclass::messagemap, &theclass::_messageentries[0] }; / afx_comdat const afx_msgmap_entry theclass::_messageentries[] = / { / #define on_command(id, memberfxn) / { wm_command, 0, (word)id, (word)id, afxsig_vv, (afx_pmsg)memberfxn }, #define end_message_map() / {0, 0, 0, 0, afxsig_end, (afx_pmsg)0 } / }; / 嘿嘿,就这么几个宏,就构造出一个消息数组来. |
|
![]() ![]() |