This documentation is archived and is not being maintained.

Exception Handling in Managed Extensions for C++

You can use both structured exception handling (SEH) and C++ exception handling in Managed Extensions for C++. Managed Extensions extend native exception handling by supporting the handling of managed exceptions. A managed exception is any exception thrown by a managed type. The System::Exception class provides many useful methods for processing managed exceptions and is recommended as a base class for user-defined exception classes.

Note   Catching exception types derived from an interface is not supported by Managed Extensions.

In This Section

Basic Concepts in Using Managed Exceptions
Describes throwing exceptions, using try/catch blocks, and using the __finally keyword in Managed Extensions.
Differences in Exception Handling Behavior Under Managed Extensions for C++
Discusses the differences from the standard behavior of C++ exception handling.

Related Sections

Provides reference information for the __try_cast keyword, which performs the specified cast or throws an exception if the cast fails.
Exception Handling
Describes exception handling in C++.
Exceptions Samples
Provides links to samples demonstrating exception handling in Managed Extensions.
Frequently Asked Questions
Provides specific answers to various questions about using Managed Extensions.