👩💻 Join our community of thousands of amazing developers!
There are two ways to throw an exception in C++/WinRT. You can throw the exception object directly: throw winrt::hresult_invalid_argument(); throw winrt::hresult_error(D3DERR_DEVICELOST); Or you can use the throw_hresult function. winrt::throw_hresult(E_INVALIDARG); winrt::throw_hresult(D3DERR_DEVICELOST); What’s the difference? If you look at the code for the throw_hresult function, The post What’s the difference between throwing a <CODE>winrt::hresult_error</CODE> and using <CODE>winrt::throw_...