1 std::string ConvertBSTRToMBS(BSTR bstr) 2 { 3 int wslen = ::SysStringLen(bstr); 4 return ConvertWCSToMBS((wchar_t*)bstr, wslen); 5 } 6 7 std::string ConvertWCSToMBS(const wchar_t* pstr, long wslen) 8 { 9 int len = ::WideCharToMultiByte(CP_ACP, 0, pstr, wslen, NULL, 0, NULL, NULL); 10 11 std::string dblstr(len, '