InteropEHinC Sample: Demonstrates Catching a Common Language Runtime Exception in an Unmanaged C Application
Visual Studio .NET 2003
The InteropEHinC sample illustrates catching a common language runtime exception thrown across a DLL boundary in C using the try-except statement. Note that the exception is thrown in managed code and caught in unmanaged code.
Building and Running the Sample
To build and run InteropEHinC using Visual Studio
- In the Visual Studio IDE, load the solution file InteropEHinC.sln.
- In Solution Explorer, right-click the InteropEHinC solution.
- On the shortcut menu, click Build.
- On the Debug menu, click Start.
The following output is displayed in the console window:
.NET Framework exception code would be e0434f4d Caught an exception -- code: e0434f4d
Classes and Keywords
This sample demonstrates the following class:
Exception
This sample demonstrates the following keywords:
__try, __except