summaryrefslogtreecommitdiff
path: root/zen/com_error.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/com_error.h')
-rw-r--r--zen/com_error.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/zen/com_error.h b/zen/com_error.h
index c67c4193..d891fa13 100644
--- a/zen/com_error.h
+++ b/zen/com_error.h
@@ -212,17 +212,16 @@ std::wstring generateErrorMsg(const std::wstring& input, HRESULT hr)
{
std::wstring output(input);
output += L"\n";
- output += L"HRESULT: " + numberToHexString(hr) + L",\n";
//don't use _com_error(hr).ErrorMessage(): internally this is nothing more than a call to ::FormatMessage()
std::wstring win32Msg = formatWin32Msg(hr);
if (!win32Msg.empty()) //empty string on error
- output += win32Msg;
+ output += win32Msg + L"\n" + L"HRESULT: " + numberToHexString(hr);
else
- {
- output += L"Facility: " + formatFacility(hr) + L",\n";
- output += L"Win32 Error: " + formatWin32Msg(HRESULT_CODE(hr)); //interpret hr as a Win32 code; this is often useful...
- }
+ output += L"HRESULT: " + numberToHexString(hr) + L", " + L"Facility: " + formatFacility(hr);
+ //don't bluntly interpret as Win32 error code HRESULT_CODE(hr), too often misleading!
+ //http://blogs.msdn.com/b/oldnewthing/archive/2006/11/03/942851.aspx
+
return output;
}
bgstack15