Dear Cool_Dev Thank you for your help I've solved this problem. Here are what I've done; First of all, It is not nessesary to move the ON_MESSAGE( USER_MESSAGE_2, &CMyWnd::OnMyMessage1HandlerApp ) entry to CMyWnd class's message map. Even though CWinApp derived class is never meant to handle windows messages, We still can hanlde windows messages in CWinApp derived class. How? This is how to get it done. It was simple. Cast the Handler in App class's message map with CWnd::* It should be like this; ON_MESSAGE( USER_MESSAGE_2, (afx_msg LRESULT(AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM))OnMyMessage1HandlerApp ) Cast the Handler with (afx_msg LRESULT(AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM)) Then, problem solved. But I haven't proved the safety of this casting during the application run-time. Well, I compiled and run the application. It seems fine. Nothing odd happened so far with this type casting. Thanks. Chan from SEOUL
modified on Wednesday, August 11, 2010 3:50 AM