无法从“void (__thiscall CtestDlg::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
来源:互联网 发布:针对淘宝店主调查问卷 编辑:程序博客网 时间:2024/06/05 14:25
按照孙鑫的教程添加自定义消息时,如果是VC6.0开发环境,也许没有什么
问题,但在VS2008中编译会报错的
无法从“void (__thiscall CtestDlg::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
这是因为VS2008中消息返回值不允许为void,且消息参数不能为空,消息映射三处分别如下
#define UM_MYMESSAGE (WM_USER + 1)
afx_msg LRESULT OnMyMessage(WPARAM wParam, LPARAM lParam);
ON_MESSAGE(UM_MYMESSAGE, OnMyMessage)
LRESULT CtestDlg::OnMyMessage(WPARAM wParam, LPARAM lParam)
{
return 1;
}
注意红色部分:VC6.0中LRESULT可以为void,且wParam, lParam参数可以不写,
但在VS2008中必须按上面方式写,即使你不使用wParam, lParam参数,没有返回值。
转载自:http://blog.csdn.net/zhuce0001/article/details/9149313
0 0
- 无法从“void (__thiscall CtestDlg::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
- 无法从“void (__thiscall CtestDlg::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
- “static_cast”: 无法从“void (__thiscall CMyNetChatDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
- error C2440 “static_cast” 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall CWnd )(WPARAM,LPARAM)”
- 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall CWnd )(WPARAM,LPARAM)”
- 2440: “static_cast”: 无法从“void (__thiscall CMainDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd:
- 无法从“void (__thiscall CCDlg::* )(WPARAM,LPARAM)”转换为“LRESULT (__thiscall CWnd::* )
- 【转】error C2440 “static_cast” 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall CWnd )(WPARAM,LPARAM)”
- 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
- error C2440 “static_cast” 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall CWnd )(WPARA
- error C2440 “static_cast” 无法从“void (__thiscall CPppView )(void)”转换为“LRESULT (__thiscall CWnd )(WPARA
- UIBezierPath贝塞尔弧线用法1
- java中的代码块
- poj1067
- C++ 中预处理Pragma的理解
- window下配置ANT工具
- 无法从“void (__thiscall CtestDlg::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
- 敏捷开发一千零一问:如何处理重要但不明确的任务?
- 字符串替换
- 深入浅出 Cocoa 之 Core Data(1) - 框架详解
- mysql忘记root密码
- Hdu4882 - ZCC Loves Codefires - 贪心(2014 Multi-University Training Contest 2-1011)
- 计算机网络--IPX、SMB
- mysql使用图形界面 使用的软件及其使用方法介绍
- dependency 中的 classifier属性