错误“static_cast”: 无法从“UINT (...)(CPoint)”转换为“LRESULT (...)(CPoint)

来源:互联网 发布:学穿搭变美的软件 编辑:程序博客网 时间:2024/05/22 17:31

VS2003之后,系统自带的窗口函数或回调函数用LRESULT,自定义的用UINT?

 

从vc6转移到vs2005   发生下面问题:
BEGIN_MESSAGE_MAP(CTestDlg,   CCaptionBtnDlg)
        ON_WM_NCHITTEST()       //vs2005   检测错误在这里
END_MESSAGE_MAP()

afx_msg   UINT   OnNcHitTest(CPoint   point);

UINT   CTestDlg::OnNcHitTest(CPoint   point)  
{
....
}

编译总是报:错误 2 error   C2440:   “static_cast”:   无法从“UINT   (__thiscall   CTestDlg::*   )(CPoint)”转换为“LRESULT   (__thiscall   CWnd::*   )(CPoint)”

CSDN上的解决办法:

afx_msg   UINT   OnNcHitTest(CPoint   point); 

UINT   CTestDlg::OnNcHitTest(CPoint   point)  

=>

afx_msg   LRESULT   OnNcHitTest(CPoint   point);      //.h

LRESULT   CTestDlg::OnNcHitTest(CPoint   point)      //.cpp

0 0
原创粉丝点击