ON_MESSAGE(UM_PROGRE,&CMainFrame::OnProgre)
error C2440: “static_cast”: 无法从“void (__thiscall CMainFrame::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
从基类型到派生类型的强制转换需要 dynamic_cast 或 static_cast
VS2005
这是怎么错了?自定义消息一定要要返回LRESULT吗?

解决方案 »

  1.   

    现在的都要的,要用
    LRESULT Fun(WPARAM wParam,LPARAM lParam)
      

  2.   

    “static_cast”: 无法从“void (__thiscall CMainFrame::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
    可以看出 &CMainFrame::OnProgre
    这句有问题,应该是CWnd 类型的。所以可以试一试 1楼的方法。
    另,如果使用VC6 尽量使用 Ctrl + W 快捷键 来让VC自动添加消息映射。不要手动添加。。