winrt::to_hresult 함수(C++/WinRT)

catch 블록에서 사용할 도우미 함수로, 마지막 예외가 HRESULT 오류 코드로 throw됩니다. winrt::hresult_error catch하는 catch 블록에서 hresult_error::to_abi 멤버 함수를 사용하여 해당 형식에서 직접 HRESULT를 가져올 수 있습니다. 다른 catch 블록에서는 winrt::to_hresult 함수를 호출하여 throw된 예외가 winrt::hresult_error, std::bad_alloc, std::out_of_range, std::invalid_argument 또는 std::exception인 경우 HRESULT를 가져올 수 있습니다.

to_hresult 거의 사용할 필요가 없는 하위 수준 함수입니다.

구문

inline __declspec(noinline) HRESULT to_hresult() noexcept;

반환 값

마지막으로 throw된 예외가 나타내는 HRESULT 오류 코드입니다.

요구 사항

지원되는 최소 SDK: Windows SDK 버전 10.0.17134.0(Windows 10, 버전 1803)

네임스페이스: winrt

헤더: %WindowsSdkDir%IncludeWindowsTargetPlatformVersion<>\cppwinrt\winrt\base.h(기본적으로 포함)

참고 항목