如何将_bstr_t转换为CString [英] How to convert _bstr_t to CString
本文介绍了如何将_bstr_t转换为CString的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 _bstr_t
变量 bstrErr
,我有一个 CString
variable 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屋!
查看全文