Member_2_99151
asked on
Error 13 error C2440 when converting MFC6 app to MFC8...
I have an old MFC6 application that i have ported across to MFC 8 (2005).
It fails compilation with the following message
Error 13 error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CMyAppName::* ) (WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' d:\source\MyApp\app1.cpp 164
The CPP file has the following:
ON_MESSAGE(WM_MYMESSAGE1, OnMyMessage1)
and
LRESULT CMyAppName::OnMyMessage1(W PARAM wParam, LPARAM lParam)
{
ULONG p1 = static_cast<ULONG> ( wParam );
ULONG p2 = static_cast<ULONG> ( lParam );
...
}
the Header file has the following:
afx_msg LRESULT OnMyMessage1(WPARAM wParam, LPARAM lParam);
There are words about this all over the internet but no simple step guides as to how to convert it!
Any help would be appreciated.
Best regards,
James
It fails compilation with the following message
Error 13 error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CMyAppName::* ) (WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' d:\source\MyApp\app1.cpp 164
The CPP file has the following:
ON_MESSAGE(WM_MYMESSAGE1, OnMyMessage1)
and
LRESULT CMyAppName::OnMyMessage1(W
{
ULONG p1 = static_cast<ULONG> ( wParam );
ULONG p2 = static_cast<ULONG> ( lParam );
...
}
the Header file has the following:
afx_msg LRESULT OnMyMessage1(WPARAM wParam, LPARAM lParam);
There are words about this all over the internet but no simple step guides as to how to convert it!
Any help would be appreciated.
Best regards,
James
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent...
Thanks for the exceptionally fastest response!
James
Thanks for the exceptionally fastest response!
James
afx_msg void OnMyMessage1(WPARAM wParam, LPARAM lParam); // <- doesn't return anything
If you have to have a return value, only solution I see is to push this function into a class that derives from CWnd.