18 std::wstring errorMessage = (err.ErrorMessage()) ? err.ErrorMessage() : L
"";
19 std::ostringstream ss;
20 ss <<
"HResult 0x" << std::hex << hr <<
": \"" << string::windows::win_to_utf(errorMessage.data()) <<
"\"";
25#define CHECK_HR_STR( call, hr ) \
28 std::ostringstream ss; \
29 ss << call << " returned: " << utilities::hresult::hr_to_string( hr ); \
30 std::string descr = ss.str(); \
31 throw std::runtime_error( descr ); \
35#define LOG_HR_STR( call, hr ) \
38 std::ostringstream ss; \
39 ss << call << " returned: " << utilities::hresult::hr_to_string( hr ); \
40 std::string descr = ss.str(); \
44#define CHECK_HR( x ) CHECK_HR_STR( #x, x )
45#define LOG_HR( x ) LOG_HR_STR( #x, x )
std::string hr_to_string(HRESULT hr)
Definition: hresult.h:15
Definition: stabilized-value.h:12