mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
140c8217f6
HRWrap now allows HRESULT to be formatted, giving useful information beyond "it failed" or a hex code that isn't obvious to most users. This commit does not add any uses of it, though.
18 lines
358 B
C++
18 lines
358 B
C++
// Copyright 2021 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "HRWrap.h"
|
|
|
|
#include <comdef.h>
|
|
#include "Common/StringUtil.h"
|
|
|
|
namespace Common
|
|
{
|
|
std::string GetHResultMessage(HRESULT hr)
|
|
{
|
|
// See https://stackoverflow.com/a/7008111
|
|
_com_error err(hr);
|
|
return TStrToUTF8(err.ErrorMessage());
|
|
}
|
|
} // namespace Common
|