Marco Monacelli
Snippets of the day: Convert from BSTR to CHAR array 
Monday, July 14, 2008, 09:12 PM
Posted by Administrator
SO: Microsoft Windows
Type: String Manipulation
Language: C++
Title: Convert from BSTR to CHAR array

BSTR is a unicode COM string, All the COM objects uses only this type of unicode string.
To convert this incompatibile string to standard ANSI C you can use this simple utils function.

char* strValue = _com_util::ConvertBSTRToString(bstrValue)

Where bstrValue are a BSTR string, and strValue are return value.

exists also the Char to BSTR utils function...

BSTR bstrValue = _com_util::ConvertStringToBSTR(strValue)
add comment ( 4 views )   |  permalink   |   ( 2.8 / 432 )

<<First <Back | 1 | 2 | 3 | Next> Last>>