VC++中的一个消息的问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 03:55:04
在CMainFrame头文件中添加了
#define UM_PROGRESS (WM_USER + 1)

afx_msg void OnProgress();
在其构造函数中添加了ON_MESSAGE(UM_PROGRESS,OnProgress)
结果出错
error C2440: 'static_cast' : cannot convert from 'void (__thiscall CMainFrame::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
None of the functions with this name in scope match the target type
求原因
VS2005 MFC单文档

恩,对你可以在afx_msg LRESULT OnProgress(WPARAM,LPARAM);上右键来找到它的定义文件,建议您装一个MSDN,可以随时查看!!!

消息处理函数定义错了,需要两个参数
afx_msg LRESULT OnProgress(WPARAM,LPARAM);