Merge pull request #11475 from shuffle2/comdef

windows: replace comdef dependency with winrt
This commit is contained in:
Pierre Bourdon 2023-01-23 15:52:51 +01:00 committed by GitHub
commit a8a4b9c6d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -7,7 +7,6 @@
// clang-format off
#include <Audioclient.h>
#include <comdef.h>
#include <mmdeviceapi.h>
#include <devpkey.h>
#include <functiondiscoverykeys_devpkey.h>

View file

@ -3,15 +3,13 @@
#include "HRWrap.h"
#include <comdef.h>
#include "Common/StringUtil.h"
#include <winrt/base.h>
namespace Common
{
std::string GetHResultMessage(HRESULT hr)
{
// See https://stackoverflow.com/a/7008111
_com_error err(hr);
return TStrToUTF8(err.ErrorMessage());
auto err = winrt::hresult_error(hr);
return winrt::to_string(err.message());
}
} // namespace Common