error C2440 不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)
来源:互联网 发布:淘宝店铺视频怎么制作 编辑:程序博客网 时间:2024/06/03 16:39
开发平台由VC6.0升级至VS2005,需要将原有的项目迁移,可能碰到类似错误:error C2440: 'static_cast' : cannot convert from 'void (__thiscall CMainFrame::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' VS2005对消息的检查更为严格,以前在VC6下完全正常运行的消息映射在VS2005下编译不通过ON_MESSAGE(WM_message,OnMyMessage); OnMyMessage返回值必须为LRESULT,其形式为:afx_msg LRESULT OnMyMessage(WPARAM, LPARAM);如果不符合,则有错误提示: error C2440: “static_cast”: 无法从“void (__thiscall CPppView::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)” 在匹配目标类型的范围内没有具有该名称的函数 error C2440: “static_cast”: 无法从“void (__thiscall CPppView::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)” 在匹配目标类型的范围内没有具有该名称的函数
解决方法如下:首先,把原来的消息函数返回值类型改为LRESULT,函数内可以随便写个return TRUE; 然后消息函数的参数必须改写成(WPARAM wParam,LPARAM lParam)而不论这两个参数是否用得到;最后,消息映射如ON_MESSAGE(WM_message,& OnMyMessage)
0 0
- error C2440 不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)
- 不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)
- 不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)
- error C2440 “static_cast” 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall CWnd )(WPARAM,LPARAM)”
- error C2440:cannotconvertfrom 'void (__thiscall CMainFrame::*)'to'LRESULT(__thiscall CWnd::*)
- 不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWn...
- 不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWn...
- 【转】error C2440 “static_cast” 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall CWnd )(WPARAM,LPARAM)”
- error C2440 static_cast:cannot convert from void (_thiscall X::*)(WPARAM,LPARAM)to LRESULT(_thiscall
- error C2440: “static_cast”: 无法从“void (__thiscall CMyDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall
- error C2440: “static_cast”: 无法从“void (__thiscall CTransparentWnd::* )(WPARAM,LPARAM)”转换为“LRESULT (__
- error C2440: “static_cast”: 无法从“void (__thiscall CChatDlg::* )(WPARAM,LPARAM)”转换为“LRESULT
- error C2440: “static_cast”: 无法从“void (__thiscall CChatDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscal
- error C2440: “static_cast”: 无法从“void (__thiscall CPppView::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscal
- error C2440: “static_cast”: 无法从“void (__thiscall CChatDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thisca
- error C2440: “static_cast”: 无法从“void (__thiscall CMYQQDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__th
- error C2440: “static_cast”: 无法从“void (__thiscall CXPButton::* )(WPARAM,LPARAM)”转换为“LRESULT (__thisca
- “static_cast”: 无法从“void (__thiscall CMyNetChatDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
- 函数索引
- 《Javascript权威指南》学习笔记之十七:BOM新成就(1)--客户端存储数据(Storage实现)
- 雅虎14条性能优化(经典)
- Java中:struts2+jQuery+ajax调用演示
- 【C语言复习(二)】struct 与 union 的分析
- error C2440 不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)
- 【27】链表反转
- java 枚举实现接口
- 获取 Chromium 源代码以及环境配置
- 找不到源文件lib.cpp
- Jenkins remote build trigger (eg: from git push) tokens
- adb命令查看包名和adb启动你的apk
- python核心编程--第八章 8.15 练习
- 使用 /sys 文件系统访问 Linux 内核