How to convert _bstr_t to CString

前端 未结 5 478
春和景丽
春和景丽 2021-01-17 10:41

I have a _bstr_t variable bstrErr and I am having a CString variable csError. How do I set the value which come in

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-17 10:59

    Is it not possible just to cast it:

    _bstr_t b("Steve");
    CString cs;
    cs = (LPCTSTR) b;
    

    I think this should work when the project is Unicode.

提交回复
热议问题