Здраствуйте, не подскажете как заставить работать следующий код, а то 2 часа лазанья по форуму что то меня ни к чему не привели.
class Base
{
public:
class MSG_MAP
{
public:
//это как вы можете понять из WinAPI для распаковщика сообшений
bool (Base::*On_Wm_Initdialog)(HWND ,HWND , LPARAM );
void (Base::*On_Wm_Command)(HWND ,int, HWND , UINT );
};
MSG_MAP _msg;
};
class FromBase: public Base
{
FromBase();
public:
bool On_Wm_Initdialog(HWND ,HWND , LPARAM){return 1;};
void On_Wm_Command(HWND ,int, HWND , UINT ){};
MSG_MAP _msg_doth;
};
FromBase::FromBase()
{
_msg_doth.On_Wm_Command = On_Wm_Command;
_msg_doth.On_Wm_Initdialog = On_Wm_Initdialog;
}
вываливается такой еррор
error C2440: '=' : cannot convert from 'void (__thiscall FromBase::* )(int,int,int,int)' to 'void (__thiscall Base::* )(int,int,int,int)'
Cast from base to derived requires dynamic_cast or static_cast
error C2440: '=' : cannot convert from 'bool (__thiscall FromBase::* )(int,int,int)' to 'bool (__thiscall Base::* )(int,int,int)'
Cast from base to derived requires dynamic_cast or static_cast
Желаьельно подскажите решение не слишком замудреное, Спасибо
FromBase::FromBase()
{
_msg_doth.On_Wm_Command = static_cast<void (Base::*)(int, int, int, int)>(On_Wm_Command);
_msg_doth.On_Wm_Initdialog = static_cast<void (Base::*)(int, int, int)>(On_Wm_Initdialog);
}