Unspecified Sample: Demonstrates Catching an Unmanaged Exception Using Managed Extensions for C++
The Unspecified sample illustrates throwing an unmanaged exception (unspecified exception) and catching it in a catch handler.
Building and Running the Sample
To build and run Unspecified using Visual Studio
- In the Visual Studio IDE, load the solution file Unspecified.sln.
- In Solution Explorer, right-click the Unspecified solution.
- On the shortcut menu, click Build.
- On the Debug menu, click Start.
The following output is displayed in the console window:
System.Runtime.InteropServices.SEHException: External component has thrown an exception. at _CxxThrowException(Void* , _s__ThrowInfo* ) at main()
Classes and Keywords
This sample demonstrates the following class:
This sample demonstrates the following keywords:
try, catch, throw