event handling - Static_cast compiler error in C++ sdi application -
i have small sdi application trying add tracking of menu usage, ie. how many times menu items selected user.
some menu items handled view component (demoview.cpp) , others main app (demoapp.cpp). since tracking structure defined in main app, believe have notify view's parent special message when menu item (handled view) selected.
if correct, problem cannot create proper on_message command. looks :
on_message(wm_increase_freq, &cdemoapp::onincreasefreq)
where onincreasefreq() defined :
lresult cdemoapp::onincreasefreq(wparam, lparam)
however error :
error c2440: 'static_cast' : cannot convert 'lresult (__thiscall cdemoapp::* )(wparam,lparam)' 'lresult (__thiscall cwnd::* )(wparam,lparam)'
i appreciate this
according error, callback function must member function of class derives cwnd. make cdemoapp derive cwnd , code should compile , work.
Comments
Post a Comment