Error c2440
"Static_cast" cannot be converted from "void (_ thiscall cpppview) (void)" to "lresult (_ thiscall cwnd) (wparam, lparam )"
You cannot convert void (_ thiscall cmainframe: *) (void) to lresult (_ thiscall cwnd: *) (wparam, lparam) development platform from vc6.0 to vs2005, you need to migrate the original project.
Similar errors may occur:
Error c2440: 'static _ cast': cannot convert from 'void (_ thiscall cmainframe ::*)
(Void) 'to 'lresult (_ thiscall cwnd: *) (wparam, lparam )'
Vs2005 checks messages more strictly. Previously, the message ing that was completely normal under vc6 failed to be compiled under vs2005.
On_message (wm_message, onmymessage );
The onmymessage return value must be lresult, in the form of afx_msg lresult onmymessage (wparam, lparam). If not, an error message is displayed:
Error c2440: "static_cast": cannot be converted from "void (_ thiscall cpppview: *) (wparam, lparam)" to "lresult (_ thiscall cwnd ::*) (wparam, lparam) "does not have a function with this name within the range that matches the target type
Error c2440: "static_cast": cannot be converted from "void (_ thiscall cpppview: *) (void)" to "lresult (_ thiscall cwnd: *) (wparam, lparam) "does not have a function with this name within the range matching the target type
The solution is as follows:
For example, on_message (wm_liben, onliben) in transparentwnd. cpp ):
First, change the type of the original message function return value to lresult (locate the onliben definition, as shown in figureViodCtransparentwnd: onliben (wparam, lparam)LresultCtransparentwnd: onliben (wparam, lparam), the declaration must also be changed, such as afx_msg
LresultOnliben (wparam, lparam ););
Second, you can write a return statement in the function.True;
Third, the parameters of the message function must be rewritten(Wparam, lparam)Whether or not these two parameters are obtained;
Fourth: Message ing, as shown in figureOn_message (wm_message, & onmymessage ).
From: http://hi.baidu.com/mike_youyou/item/c685c11212bf998a99ce33a7