O'Reilly logo

.NET and COM: The Complete Interoperability Guide by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix D. .NET Exception to HRESULT Transformations

Every .NET exception type has a protected HResult field that is exposed to COM as an HRESULT when the exception is thrown. This appendix lists the HRESULT value for every .NET exception defined in the .NET Framework—more than just the mscorlib assembly.

Table D.1 lists the HRESULTs numerically, answering a COM programmer’s question, “What .NET exception was likely thrown to cause this failure HRESULT?” Some of this information can be obtained programmatically by calling the System.Runtime.InteropServices.Marshal.ThrowExceptionForHR method, but only for a subset of the HRESULTs. The word “likely” is used because, in general, it’s impossible to know what .NET exception was thrown from an ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required