c++Builder 2009 2010 出现Cannot convert 'wchar_t *' to 'const char *
来源:互联网 发布:用java写雷电x 小游戏 编辑:程序博客网 时间:2024/06/06 04:02
Function(char * some)
Function(edit->Text.c_str()) //结果就在这行出现Bug Cannot convert 'wchar_t *' to 'const char *
解决方法
菜单"Project"-》“Options”-》“Directories and Conditionals ”选项
_TCHAR maps to char
上面代码改成Function(edit->Text.t_str()) ;
引用c++ Builder 妖刀版主的
2009中的String有三个转换成字符串指针的函数:
c_str() 这个应该是为了兼容旧版本的代码,返回类型为wchar_t *
w_str() 返回wchar_t *
t_str() 这个函数的返回值依赖工程选项中_TCHAR的映射类型,如果映射为char,返回char *,映射为wchar_t,返回wchar_t *
0 0
- c++Builder 2009 2010 出现Cannot convert 'wchar_t *' to 'const char *
- cannot convert wchar_t to const char*
- E2034 Cannot convert 'wchar_t *' to 'const char *'
- cannot convert parameter 1 from 'const char [] ' to 'const wchar_t * '的解决方法
- cannot convert parameter 1 from 'const char [] ' to 'const wchar_t * '的解决方法
- cannot convert parameter 1 from 'const char [] ' to 'const wchar_t * '的解决方法
- cannot convert from 'const char [n]' to 'LPCWSTR'2009
- Cannot convert from 'const char [..]' to 'LPCTSTR'
- Cannot convert from 'const char [..]' to 'LPCTSTR'
- VC++ 出现错误:cannot convert from const char *' to 'LPCWSTR' 或者'const char [7]' to 'LPCWSTR' 的解决方法
- VC++ 出现错误:cannot convert from 'const char [7]' to 'LPCWSTR'和 宏 _T()用处
- cannot convert from w_char_t * to const char * 编译tinyXml 工程出现的问题
- VC++ 出现错误:cannot convert from 'const char [7]' to 'LPCWSTR'和 宏 _T()用处
- Vs2010出现错误:cannot convert from 'const char [7]' to 'LPCWSTR'
- 在UNICODE编码格式下使用cvSaveImage出现cannot convert from 'CString' to 'const char *
- cannot convert from 'const int' to 'const char *'
- cannot convert from 'const char [51]' to 'const CString'
- cannot convert parameter 1 from 'CString' to 'const char *'
- 开源完整版:《开源框架实战宝典电子书V1.0.0》内测版下载地址!
- js输入一个日期判断该日期是该年的第几天
- 使用ANT编译项目报错 com.sun.image.codec.jpeg does not exist 解决方法
- Tkinter 控件详细介绍
- iOS代理模式
- c++Builder 2009 2010 出现Cannot convert 'wchar_t *' to 'const char *
- 整数实现翻转---java实现
- Cordys JAVA Object理解
- stm32操作时钟芯片ds1390
- 类的加载、执行顺序
- win8让触摸键盘透明
- 3Sum Closest
- 观察者模式 - 行为模式
- jsp-DB