message reflection
-
I am using message reflection in myButton class so what i have in the message map is as below: BEGIN_MESSAGE_MAP(myButton, CButton) ON_CONTROL_REFLECT(BN_CLICKED, onButtonClick) END_MESSAGE_MAP() the prototype for onButtonClick() is afx_msg void onButtonClick() and this works well. But i do want the parent as well to be notified so as mentioned in the MFC doc i modified the onButtonClick to return BOOL so it is then afx_msg BOOL onButtonClick() But this gives a compile time error : error C2440: 'static_cast' : cannot convert from 'BOOL (__thiscall aegis::myButton::* )(void)' to 'AFX_PMSG' None of the functions with this name in scope match the target type. Any suggestions or is it a yet another bug in mfc. thanks
-
I am using message reflection in myButton class so what i have in the message map is as below: BEGIN_MESSAGE_MAP(myButton, CButton) ON_CONTROL_REFLECT(BN_CLICKED, onButtonClick) END_MESSAGE_MAP() the prototype for onButtonClick() is afx_msg void onButtonClick() and this works well. But i do want the parent as well to be notified so as mentioned in the MFC doc i modified the onButtonClick to return BOOL so it is then afx_msg BOOL onButtonClick() But this gives a compile time error : error C2440: 'static_cast' : cannot convert from 'BOOL (__thiscall aegis::myButton::* )(void)' to 'AFX_PMSG' None of the functions with this name in scope match the target type. Any suggestions or is it a yet another bug in mfc. thanks
got rid of the compilation error need to use ON_COMMAND_REFLECT_EX. So now my code compiles and runs but the handler of the parent is not invoked why?? although i do have an onButtonClick in the parent.