Click to See Complete Forum and Search --> : How about an article for converting bstrs


wil_cdr
March 17th, 2000, 04:47 AM
It'll be nice if someone can post an article regarding conversion of bstrs (basic strings) to various other formats, like CString, and vice versa.

Thanks!

May 10th, 2000, 09:38 AM
I am thinking that is not neccessarly one article for this. Anyway here few hints about: CString s(OLE2T(bstrString)), ::SysAllocString( T2OLE("test") gives you a copy of BSTR. Where OLE2T and T2OLE could be found in ATL sources. Befroe using these macros you have to call USES_CONVERSION.
Mihai

Miles Davies
September 28th, 2000, 05:54 AM
You may want to check out _bstr_t and CComBSTR also. The thing to watch out for is BSTR can contain nulls. It's not very likely but should be considered