diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-22 13:13:10 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-22 13:13:10 +0200 |
commit | 8566655b85f0a4e515d57f6686636db516116f95 (patch) | |
tree | d27ec314359a083210492a371b5fce1761e734ae /c/win.cpp | |
parent | ee1eafe1ed12c2c46ed31ad560daeae11ab1e027 (diff) | |
download | EpisodeBrowser-8566655b85f0a4e515d57f6686636db516116f95.tar.gz |
Improve Win32Error, add Min.
Diffstat (limited to 'c/win.cpp')
-rw-r--r-- | c/win.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -124,8 +124,8 @@ int GetRelativeCursorPos(const HWND hWnd, POINT* const pt) noexcept return 1; } -Win32Error::Win32Error(const DWORD code) noexcept - : code(code) {} +Win32Error::Win32Error(const DWORD code, const HMODULE hModule) noexcept + : code(code), hModule(hModule) {} Win32Error::~Win32Error() { @@ -143,7 +143,7 @@ const char* Win32Error::what() const noexcept |FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_FROM_HMODULE |FORMAT_MESSAGE_IGNORE_INSERTS, - GetModuleHandle(L"wininet.dll"), + hModule, code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (char*)&m_szMsg, @@ -159,7 +159,7 @@ const wchar_t* Win32Error::What() const noexcept |FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_FROM_HMODULE |FORMAT_MESSAGE_IGNORE_INSERTS, - GetModuleHandle(L"wininet.dll"), + hModule, code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (wchar_t*)&m_wszMsg, @@ -170,7 +170,7 @@ const wchar_t* Win32Error::What() const noexcept InternetError::InternetError(DWORD codeSystem) { if (codeSystem != ERROR_INTERNET_EXTENDED_ERROR) - throw Win32Error(codeSystem); + throw Win32Error(codeSystem, GetModuleHandle(L"wininet.dll")); DWORD len, cch; InternetGetLastResponseInfo(&code, nullptr, &len); |