问题
I am converting a VC++6.0 project to Visual Studio 2008 (enroute to 2014). I am encountering the above error.
Here is my code snippet:
BEGIN_MESSAGE_MAP(CImportProjectDlg, CDialog)
//{{AFX_MSG_MAP(CImportProjectDlg)
ON_WM_SIZE()
ON_WM_GETMINMAXINFO()
ON_WM_SIZING()
ON_WM_PAINT()
ON_WM_NCHITTEST()
ON_BN_CLICKED(IDC_MERGE_IN, OnAdd)
ON_BN_CLICKED(IDC_MERGE_OUT, OnRemove)
ON_BN_CLICKED(IDC_IMPORTPROJECT_CLEARALL, OnClearAll)
ON_BN_CLICKED(IDC_IMPORTPROJECT_APPLY, OnApply)
ON_BN_CLICKED(IDCANCEL,OnCancel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
And the error is indicated on the ON_WM_NCHITTEST() line.
Very puzzling.
回答1:
The correct signature for OnNcHitTest
handler is afx_msg LRESULT OnNcHitTest(CPoint);
. You have it return UINT
instead of LRESULT
.
来源:https://stackoverflow.com/questions/42442457/error-c2440-static-cast-cannot-convert-from-uint-thiscall-cimportprojec