How to convert _bstr_t to CString
问题 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 ? 回答1: 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. 回答2: CString has contructors and assignment operators for both LPCSTR and LPCWSTR, so there is never a need to call WideCharToMultiByte, and you can't get the casting wrong in unicode or non-unicode mode. You can