error C2440: “static_cast”: 無法從“UINT (__thiscall CSizingControlBar::* )(CPoint)”轉換為“LRESULT (__thiscall CWnd::* )(CPoint)” f:\tools\4bands ifx_xmm2130_ft\common\sizecbar.cpp 109
CWnd類,afx_msg LRESULT OnNcHitTest(CPoint point);
而在CSizingControlBar中是afx_msg UINT OnNcHitTest(CPoint point);
只要將這些UINT替換為LRESULT就可以了。
查找OnNcHitTest,將下面兩行:
afx_msg UINT OnNcHitTest(CPoint point);//.h
UINT CTestDlg::OnNcHitTest(CPoint point);//.cpp
改為:
afx_msg LRESULT OnNcHitTest(CPoint point);//.h
LRESULT CTestDlg::OnNcHitTest(CPoint point);//.cpp
另外一個小問題:
CString atMyCmd;
atMyCmd+=0x0d;
編譯時出現“operator+=不明確”。改正方法:atMyCmd+=(char)0x0d;因為從unsigned int轉換到CString和char的等級都是標准轉換,所以編譯器無法判斷到底應該轉換到哪一個,所以就導致了這個問題,所以應該強制轉換。