A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/uwp/cpp-ref-for-winrt/error-handling/throw-hresult below:

winrt::throw_hresult function (C++/WinRT) - Windows UWP applications

A helper function that takes a HRESULT error code, and throws an exception using a C++/WinRT object (or a standard object) that represents that error code.

If the error code is E_OUTOFMEMORY, then std::bad_alloc is thrown. If the error code is a common HRESULT error code, then one of the specialized types derived from winrt::hresult_error is thrown. For example, E_INVALIDARG causes a winrt::hresult_invalid_argument to be thrown. Otherwise, winrt::hresult_error is thrown.

Syntax
[[noreturn]] inline __declspec(noinline) void throw_hresult(HRESULT const result);
Parameters

result An HRESULT code that represents the error that was encountered.

Requirements

Minimum supported SDK: Windows SDK version 10.0.17134.0 (Windows 10, version 1803)

Namespace: winrt

Header: %WindowsSdkDir%Include<WindowsTargetPlatformVersion>\cppwinrt\winrt\base.h (included by default)

See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4