COM Interop supports error handling from .NET to COM and from COM to .NET. Each HResult in COM is mapped to a .NET exception. Hence, if an exception is thrown in a .NET source, the CCW maps the exception to an HResult using the ISupportErrorInfo interface, which results in an Err object being created in VB6. If a VB6 COM source raises an error, the RCW converts the VB6 COM HResult into a .NET exception, and the mapped exception is thrown in .NET. Check out the VS .NET help topic ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconhresultsexceptions.htm for a complete mapping between HResult values and .NET exception classes. |