Why stick that there?
I know it’s because the class is from waaay back when the SBCS APIs were still actually being used, but …
// Extract a const wchar_t*
//
inline _bstr_t::operator const wchar_t*() const throw()
{
return (m_Data != NULL) ? m_Data->GetWString() : NULL;
}
// Extract a const char_t*
//
inline _bstr_t::operator const char*() const
{
return (m_Data != NULL) ? m_Data->GetString() : NULL;
}
BSTR is a Unicode string, and the second extractor above converts it
to ANSI. This, unfortunately, results in ambiguous-overload errors
whenever a _bstr_t
is passed to anything that can accept both
forms.
There should really be a way to, say, #define _BSTR_T_NO_ANSI_SUPPORT
.