Skip to Content
.NET and COM: The Complete Interoperability Guide
book

.NET and COM: The Complete Interoperability Guide

by Adam Nathan
January 2002
Intermediate to advanced
1608 pages
38h 34m
English
Sams
Content preview from .NET and COM: The Complete Interoperability Guide

Appendix C. HRESULT to .NET Exception Transformations

When a COM member (or PInvoke signature marked with PreserveSig=false) returns a failure HRESULT, a .NET exception is thrown. The type of the exception depends on the HRESULT value, according to the tables in this appendix. The exceptions listed are the only ones that can be directly thrown by the CLR in response to a COM object returning a failure HRESULT, and are a subset of the exceptions defined in the mscorlib assembly. The only reason that the list doesn’t include all exceptions defined in mscorlib is that a handful of exceptions share the same HRESULT values, so one exception type must be chosen when the shared value is returned from COM.

Table C.1 lists exception types alphabetically ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

.NET and COM Interoperability Handbook, The

.NET and COM Interoperability Handbook, The

Alan Gordon
COM Programming with Microsoft® .NET

COM Programming with Microsoft® .NET

John Paul Mueller, Julian Templeman

Publisher Resources

ISBN: 9780672333583Purchase book