Exception Handling (C++ Component Extensions)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

Applications compiled with the /ZW compiler option or /clr compiler option both use exceptions to handle unexpected errors during program execution. The following topics discuss exception handling in either C++/CX or C++/CLI applications.

Basic Concepts in Using Managed Exceptions
Describes throwing exceptions and using try/catch blocks.

Differences in Exception Handling Behavior Under /CLR
Discusses the differences from the standard behavior of C++ exception handling.

finally
Discusses how to use the finally keyword.

How to: Define and Install a Global Exception Handler
Demonstrates how unhandled exceptions can be captured.

How to: Catch Exceptions in Native Code Thrown from MSIL
Discusses how to catch CLR and C++ exceptions in native code.

How to: Define and Install a Global Exception Handler
Demonstrates how to catch all unhandled exceptions.

Exception Handling
Describes exception handling in C++.

Component Extensions for Runtime Platforms

Show: