关于字符串类型转换的问题,在线给分!

watersome 2004-09-20 09:21:07
除了wsprintf()之外还有没有其他将char[]转换到WCHAR[]的方法?

因为我在编译单独的源文档的时候由于使用了project setting中的preprocessor definitions:_UNICODE,UNICODE wsprintf编译成功,但是在对整个工程进行rebuild时,在其他文档中发生了对UNICODE不兼容的问题,例如strlen()的调用问题: error C2664: 'strlen' : cannot convert parameter 1 from 'const unsigned short *' to 'const ch。

为了解决这个问题,在project setting中的preprocessor definitions:中取消了_UNICODE,UNICODE ,并单独在要使用wsprintf()的文档中定义了UNICODE和_UNICODE,但 error C2664: 'wsprintfA' : cannot convert parameter 1 from 'unsigned short [81]' to 'char *'

请各位高手指教。或者有没有其他的转换方法。在线等!

...全文
68 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
DentistryDoctor 2004-09-20
  • 打赏
  • 举报
回复
strlen
=>
_tcslen
huaboy408 2004-09-20
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/3320/3320756.xml?temp=.3085291

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧