Tuesday, January 15, 2008

BSTR to String Conversion

#include
std::string myString = _bstr_t (myBSTR);

or

BSTR status= ::SysAllocString(L"Hello World");

CW2A pszConverted (status);

std::string string_key(pszConverted);