Hi
I am trying to port old version C++ code into Visual Studio 2013. When I am trying to do this, I am getting the following error.
1> INVOICEView.cpp
1>INVOICEView.cpp(23): error C2440: 'static_cast' : cannot convert from 'int (__thiscall CINVOICEView::* )(void)' to 'AFX_PMSG'
1> None of the functions with this name in scope match the target type
1>INVOICEView.cpp(23): fatal error C1903: unable to recover from previous error(s); stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here is the code....
ON_COMMAND(ID_SAVE_TO_HOST, OnSaveToHost)
#define ON_COMMAND(id, memberFxn) \
{ WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)id, AfxSigCmd_v, \
static_cast (memberFxn) },
// ON_COMMAND(id, OnBar) is the same as
// ON_CONTROL(0, id, OnBar) or ON_BN_CLICKED(0, id, OnBar)
int CINVOICEView::OnSaveToHost()
{
return (SaveToHost());
}
Any help to fix the above error would be appreciated. Please do let me know if you need any additional details. Thank you.
↧