6

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.

2 Answers 2

6

The correct signature for OnNcHitTest handler is afx_msg LRESULT OnNcHitTest(CPoint);. You have it return UINT instead of LRESULT.

Sign up to request clarification or add additional context in comments.

6 Comments

It is unclear to me how and where to change the UINT into LRESULT.
CImportProjectDlg has a method named OnNcHitTest. This method is currently defined to return UINT. Change it to return LRESULT.
I feel a little out of my depth.... do I change the declaration: UINT CImportProjectDlg::OnNcHitTest(CPoint point) to LRESULT. or do I change the return code to LRESULT?
You change the return type from UINT to LRESULT, so the declaration becomes LRESULT CImportProjectDlg::OnNcHitTest(CPoint point)
The function is likely declared in an .h file, and defined in a .cpp file. You've updated it in one place but not the other. Update both.
|
1

If you need to let the source code compiled both on VC6 and vs2008 (unfortunately), you may use _MSC_VER to handle it.

Full list here

#if _MSC_VER >= 1500 // For vs2008+ LRESULT #else UINT #endif CImportProjectDlg::OnNcHitTest(CPoint point) 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.