error+c2440+static+cast
网友评论:
丰睿17734301201:
error C2440: 'static - cast' : cannot convert from 'LRESULT (--thiscall CchatDlg::* )(CPoint)' to 'UI -
63988钮樊
: 出现这个错误的原因可是“人力不可抗拒”之原因造成的,因为旧版本的 ON_WM_NCHITTEST 宏使用了 UINT (__thiscall CWzButton::* )(CPoint); 类型的类成员函数指针,其定义如下: #define ON_WM_NCHITTEST() \ { WM_NCHITTEST, 0, 0...
丰睿17734301201:
C语言错误error C2440: '=' : cannot convert from 'void' to 'int'是什么问题? -
63988钮樊
: 这是把void类型的值赋给int变量 当然不可以了 比如一个void函数A void A(){} int变量 x int x;x=A();就会出现
丰睿17734301201:
error C2440: 'static - cast' : cannot convert from 'void (--thiscall CChatDlg::* )(WPARAM,LPARAM)' to -
63988钮樊
: 你这个问题应该是VC6项目迁移向高版本时发生的,VC6后消息的检查更为严格,以前在VC6下完全正常运行的消息映射在其它版本下编译不通过.解决方法如下: 首先,把原来的消息函数返回值类型改为LRESULT,函数内可以随便写个return TRUE; 然后消息函数的参数必须改写成(WPARAM wParam,LPARAM lParam)而不论这两个参数是否用得到;最后,消息映射如ON_MESSAGE(WM_message,& OnMyMessage)
丰睿17734301201:
vs2010 中,c++:Error 1 error C2440: 'static - cast' : cannot convert from 'CString' to 'char *' -
63988钮樊
: 本人收藏的CString to char *的转换方法,供你参考 若将CString类转换成char*(LPSTR)类型,常常使用下列三种方法:方法一,使用强制转换.例如:CString theString( “This is a test” ); LPTSTR lpsz =(LPTSTR)(LPCTSTR)theString; 方法二...
丰睿17734301201:
error C2440: 'initializing' : cannot convert from 'std::string' to 'System::String ^' -
63988钮樊
: string str1="42";string str2="ab";array^tests = {str1,st...
丰睿17734301201:
error C2440: “static - cast”: -
63988钮樊
: 原因:VC6程序在VS2008中编译 解决:将UINT改成LRESULT
丰睿17734301201:
请教各位大侠帮忙指教error C2440: 'static - cast' : cannot convert from 'LRESULT (--thisc--------Dlg: -
63988钮樊
: 不能转换void (_thiscall CMainFrame::*)(void)to LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)2010-05-13 11:35开发平台由VC6.0升级至VS2005,需要将原有的项目迁移,可能碰到类似错误:error C2440: 'static_cast' : cannot convert ...
丰睿17734301201:
error C2440: '=' : cannot convert from 'int [2][2]' to 'int *' -
63988钮樊
: 这个代码会报告以下错误:error C2440: '=' : cannot convert from 'int [2][2]' to 'int *' 意思是:无法把2*2的整型数组(地址)转变成整型指针. 修改成: #include<stdio.h>void main(){ int s[2][2]={1,2,3,4}; int *p; p=s[0]; printf("%d",*(p+1))...
丰睿17734301201:
vs2010 中,c++:Error 1 error C2440: 'static - cast' : cannot convert from 'CString' to 'char *' -
63988钮樊
: CString theString( “This is a test” );LPTSTR lpsz = new TCHAR[theString.例如:CString s(_T(”This is a test “)):CString theString( “This is a test” );LPTSTR p = s.GetBuffer();/LPTSTR lpsz =(LPTSTR)(LPCTSTR)theString:方法一;MBCS...
丰睿17734301201:
error C2440: 'initializing' : cannot convert from 'const int *' to 'int *const ' -
63988钮樊
: 这个问题首先得理解指针常量和常量指针的区别,简单的说指针常量即指针是常量,也就是指针的指向不能再改变了.常量指针即指针指向的内容是常量,即指针指向的内容是不能改变的.一般区分这两种指针可以看const的位置,如果定义的时候再 * 前则为常量指针,在 * 后面则为指针常量.问题中对const变量ic取址即类似于定义了一个常量指针,而 int *const cpi则定义了一个指针常量.两个完全不一样的东西赋值,因此会报类型转换错误!语言表达能力有限,希望对你有所帮助,嘿嘿.