Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 500
subbu Avatar asked Nov 06 '09 06:11

subbu


1 Answers

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.

like image 93
Andrew Avatar answered Sep 28 '22 06:09

Andrew