Skip to Content
.NET Common Language Runtime Unleashed
book

.NET Common Language Runtime Unleashed

by Kevin Burton
April 2002
Intermediate to advanced content levelIntermediate to advanced
1024 pages
23h 26m
English
Sams
Content preview from .NET Common Language Runtime Unleashed

COM Exceptions

You would not expect an exception here. One of the core principles behind COM is that exceptions cannot cross COM method boundaries. Here, unlike the unmanaged exceptions of the previous section, no exceptions are thrown in unmanaged code. Where are the exceptions coming from? As you saw in Chapter 8, “Using COM/COM+ in Managed Code,” to call a COM component in managed code, a wrapper must be constructed to form an interop layer between the managed code and unmanaged code. As far as exceptions are concerned, the returned HRESULT from the COM method is turned into an exception by this interop layer. This translation is not unlike that which was occurring when code was imported like this:

#import "msxml3.dll"

When the compiler ...

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

Customizing the Microsoft® .NET Framework Common Language Runtime

Customizing the Microsoft® .NET Framework Common Language Runtime

Steven Pratschner

Publisher Resources

ISBN: 0672321246Purchase book