Marshal.GetExceptionForHR Method (Int32)
Converts the specified HRESULT error code to a corresponding Exception object.
Assemblies: System.Runtime.InteropServices (in System.Runtime.InteropServices.dll)
mscorlib (in mscorlib.dll)
The current IErrorInfo interface is used to construct the exception.
For the mapping from each HRESULT to its comparable exception class in the .NET Framework, see How to: Map HRESULTs and Exceptions.
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.