注册 登录
编程论坛 VC++/MFC

该程序在VS2005中运行为什么会出现以下错误?(红字是错误)。

kxfei5555w 发布于 2010-10-16 15:15, 1397 次点击
BEGIN_MESSAGE_MAP(CRecordHWndDlg, CDialog)
    //{{AFX_MSG_MAP(CRecordHWndDlg)
    ON_WM_SYSCOMMAND()
    ON_WM_PAINT()
    ON_WM_QUERYDRAGICON()
    ON_BN_CLICKED(IDC_REC_START, OnRecStart)
    ON_BN_CLICKED(IDC_REC_STOP, OnRecStop)
    ON_MESSAGE(MM_WIM_OPEN,OnMM_WIM_OPEN)
    ON_MESSAGE(MM_WIM_DATA,OnMM_WIM_DATA)
    ON_MESSAGE(MM_WIM_CLOSE,OnMM_WIM_CLOSE)
    ON_MESSAGE(MM_WOM_OPEN,OnMM_WOM_OPEN)
    ON_MESSAGE(MM_WOM_DONE,OnMM_WOM_DONE)
    ON_MESSAGE(MM_WOM_CLOSE,OnMM_WOM_CLOSE)
    ON_WM_DESTROY()
    ON_BN_CLICKED(IDC_PLAY_START, OnPlayStart)
    ON_BN_CLICKED(IDC_PLAY_PAUSE, OnPlayPause)
    ON_BN_CLICKED(IDC_PLAY_STOP, OnPlayStop)
    ON_WM_TIMER()
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()
1>f:\vs下载的程序\13297912基于api录音机程序\recordhwnd\recordhwnddlg.cpp(97) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CRecordHWndDlg::* )(UINT,LONG)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1>        None of the functions with this name in scope match the target type
1>f:\vs下载的程序\13297912基于api录音机程序\recordhwnd\recordhwnddlg.cpp(98) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CRecordHWndDlg::* )(UINT,LONG)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1>        None of the functions with this name in scope match the target type
1>f:\vs下载的程序\13297912基于api录音机程序\recordhwnd\recordhwnddlg.cpp(99) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CRecordHWndDlg::* )(UINT,LONG)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1>        None of the functions with this name in scope match the target type
1>f:\vs下载的程序\13297912基于api录音机程序\recordhwnd\recordhwnddlg.cpp(100) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CRecordHWndDlg::* )(UINT,LONG)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1>        None of the functions with this name in scope match the target type
1>f:\vs下载的程序\13297912基于api录音机程序\recordhwnd\recordhwnddlg.cpp(101) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CRecordHWndDlg::* )(UINT,LONG)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1>        None of the functions with this name in scope match the target type
1>f:\vs下载的程序\13297912基于api录音机程序\recordhwnd\recordhwnddlg.cpp(102) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CRecordHWndDlg::* )(UINT,LONG)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
1>        None of the functions with this name in scope match the target type
1>Build log was saved at "file://f:\VS下载的程序\13297912基于API录音机程序\RecordHWnd\Debug\BuildLog.htm"
4 回复
#2
cnfarer2010-10-16 21:21
这似乎是不同版本程序之间的问题!
#3
沼泽2010-10-16 22:49
根据错误提示,是你的函数格式与标准不相同
#4
kxfei5555w2010-10-17 18:53
回复 2楼 cnfarer
的确,这原来是用Windowsapi做的,我在VS2005下运行的,能给点修改的方法不?
#5
wynemo2010-10-21 14:17
void (__thiscall CRecordHWndDlg::* )(UINT,LONG) 是现在程序的形式,你改为LRESULT (__thiscall CRecordHWndDlg::* )(WPARAM,LPARAM) 形式的,相应的有返回值,搞个return 0,参数值自己试着修改下
1