Top "Hresult" questions

How can I throw an Exception with a certain HResult?

I want to test the following code: private bool TestException(Exception ex) { if ((Marshal.GetHRForException(ex) & 0xFFFF) == 0x4005) { return …

c# exception testing marshalling hresult
How to convert HRESULT into an error description?

Say, if I have a WinAPI that fails with an HRESULT code. Is there a way to convert it to …

c++ windows winapi hresult