summaryrefslogtreecommitdiff
path: root/zen/com_error.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
commitc8e0e909b4a8d18319fc65434a10dc446434817c (patch)
treeeee91e7d2ce229dd043811eae8f1e2bd78061916 /zen/com_error.h
parent5.2 (diff)
downloadFreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip
5.3
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