Programming Tips - MSVC: Why does my Visual C++ 6 program not compile in Visual C++ 7 ?

Date: 2009oct11 Update: 2025jul12 Platform: win32 Framework: MFC Language: C/C++ Q. MSVC: Why does my Visual C++ 6 program not compile in Visual C++ 7 ? (Visual C++ 7 is part of Visual Studio 2005) A. Some prototypes changed from VC6 to VC7... (Visual C++ 7 is part of Visual Studio 2005)
ON_MESSAGE(WM_SOMEMESSAGE, OnSomeMessage) vc6: // Didn't care vc7: afx_msg LRESULT OnSomeMessage(WPARAM, LPARAM);
ON_BN_CLICKED(IDC_MYBUTTON, OnMyButtonClicked) vc6: afx_msg LRESULT OnMyButtonClicked(WPARAM, LPARAM) vc7: afx_msg void OnMyButtonClicked();
ON_LBN_DBLCLK(IDC_LIST, OnDblclkList) vc6: afx_msg void OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult); vc7: afx_msg void OnDblclkList(); // This is AFX_PMSG
ON_WM_COPYDATA() vc6: afx_msg LONG OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct); vc7: afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct); // Return changes
ON_NOTIFY_REFLECT_EX(NM_CUSTOMDRAW, OnCustomDraw) vc6: void afx_msg OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult); vc7: BOOL afx_msg OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult); // Return changed // TRUE only when you have processed the message
ON_WM_TIMER() vc6: afx_msg void OnTimer(int); vc7: afx_msg void OnTimer(UINT_PTR);
Probably others too.