24 WindowsException::WindowsException(
char const*
const file,
unsigned int const line, std::string
const& what, HRESULT
const hResult ) {
26 _com_error error( hResult );
29 wchar_t const*
const message16 = error.ErrorMessage();
31 WideCharToMultiByte( CP_UTF8, 0, message16, -1, message,
ARRAYLENGTH( message ), NULL, NULL );
33 char const*
const message = error.ErrorMessage();
36 std::stringstream stream;
38 m_what = stream.str();
42 WindowsException::~WindowsException() throw() {
48 return m_what.c_str();