很简单的控件问题,高分! 怎么在EDIT中读出char类型的字符串? 或: 怎么把CString转换成char字符串?或: 还有其他替代方法? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1、CString str;GetDlgItem(IDC_EDIT)->GetWindowText(str);之后可以用(LPTSTR)str,就会转换为字符串指针2、TCHAR str[100];GetDlgItem(IDC_EDIT)->GetWindowText(str, 100); to 1.编译器提示:error C2440: 'type cast' : cannot convert from 'class CString' to 'char *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be calledError executing cl.exe. (LPTSTR)str或(LPCTSTR)str而不是(char *)str或(const char *)str wndcls.lpfnWndProc=WindowSumProc;这个函数什么时候被调用的呢? CFile打开文件时"发生共享违例" 有人用VC2005编译过secondlife吗?来帮兄弟一把! 请问如何提高绘图速度。 为什么列表控件的标题第一个无法居中? 两个问题,谢谢! 请问ADOX.DLL有哪些对象呀 请教关于RPC得较难问题 怎样实现组播 COleDropTarget类的注册问题 hostent结构中都有什么? 谁有这本书“OpenGL高级编程与可视化系统开发(高级编程篇)”的光盘程序???
CString str;
GetDlgItem(IDC_EDIT)->GetWindowText(str);
之后可以用(LPTSTR)str,就会转换为字符串指针
2、
TCHAR str[100];
GetDlgItem(IDC_EDIT)->GetWindowText(str, 100);
编译器提示:
error C2440: 'type cast' : cannot convert from 'class CString' to 'char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
而不是(char *)str或(const char *)str