Put this in your message map declaration in your .h file...DECLARE_EVENTSINK_MAP()And this in the corresponding .cpp file (arsewizard usually puts these sorts of things near the top of the code)...BEGIN_EVENTSINK_MAP(CYourCtrl, COleControl) //{{AFX_EVENTSINK_MAP(CYourCtrl) ON_EVENT(CYourCtrl,<ctrl ID>,<event ID>/*<event name>*/,<handler function name>,<param type codes>) //}}AFX_EVENTSINK_MAP END_EVENTSINK_MAP()
在OnCommand里面可以获得BN_CLICKED事件.
LOWORD HIWORD
具体看msdn
of things near the top of the code)...BEGIN_EVENTSINK_MAP(CYourCtrl, COleControl)
//{{AFX_EVENTSINK_MAP(CYourCtrl)
ON_EVENT(CYourCtrl,<ctrl ID>,<event ID>/*<event name>*/,<handler
function name>,<param type codes>)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()