如何将 _bstr_t 转换为 CString [英] How to convert _bstr_t to CString
本文介绍了如何将 _bstr_t 转换为 CString的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 _bstr_t
变量 bstrErr
并且我有一个 CString
变量 csError
.如何将 bstrErr
中的值设置为 csError
?
I have a _bstr_t
variable bstrErr
and I am having a CString
variable csError
. How do I set the value which come in bstrErr
to csError
?
推荐答案
是不是只能投了:
_bstr_t b("Steve");
CString cs;
cs = (LPCTSTR) b;
我认为当项目是 Unicode 时这应该可以工作.
I think this should work when the project is Unicode.
这篇关于如何将 _bstr_t 转换为 CString的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文