Here is the code:
//h file
class MyClass: public CView
{
public:
afx_msg LRESULT OnMyMess(WPARAM, LPARAM);
}
//cpp file
BEGIN_MESSAGE_MAP(MyClass, CView)
ON_MESSAGE(WM_USER+100, OnMyMess)
END_MESSAGE_MAP()
LRESULT OnMyMess(WPARAM, LPARAM)
{return 0};
//Somewhere in the programm
SendMessage(WM_USER+100, 0 ,0);
Why doesn’t the program call the handler?
upd: WinXP, MS VS 2003
First,
should be
but I guess it’s just a typo.
Second,
SendMessageshould work as expected, only if it’s in the MyClass that you’re calling it; otherwise, you should specify the window to which you want to send the message.