Unspecified Sample: Demonstrates Catching an Unmanaged Exception Using Managed Extensions for C++

Unspecified Sample: Demonstrates Catching an Unmanaged Exception Using Managed Extensions for C++

Visual Studio .NET 2003

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

  1. In the Visual Studio IDE, load the solution file Unspecified.sln.
  2. In Solution Explorer, right-click the Unspecified solution.
  3. On the shortcut menu, click Build.
  4. 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:

Exception

This sample demonstrates the following keywords:

try, catch, throw

See Also

Managed Extensions for C++ Samples

Show:
© 2016 Microsoft