System.Runtime.InteropServices.SEHException Class

Represents structured exception handling (SEH) errors.

See Also: SEHException Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class SEHException : ExternalException

Remarks

The System.Runtime.InteropServices.SEHException class handles SEH errors that are thrown from unmanaged code, but that have not been mapped to another .NET Framework exception. The System.Runtime.InteropServices.SEHException class also responds to the HRESULT E_FAIL, which has the value 0x80004005.

The .NET Framework often encounters unmanaged SEH exceptions that are automatically mapped to managed equivalents. There are two common unmanaged SEH exceptions:

Any SEH exception that is not automatically mapped to a specific exception is mapped to the System.Runtime.InteropServices.SEHException class by default.

For more information, search on "unmanaged exceptions" and "Structured Exception Handling" in the MSDN Library.

Note that the System.Runtime.InteropServices.SEHException class does not cause unmanaged C++ exception destructors to be called. To ensure that unmanaged C++ exception destructors are called, use the following syntax in the catch block.

[Visual Basic]

Example

Catch 
     ' Handle catch here.
End Try

[C#]

Example

catch
{
     // Handle catch here.
}

[C++]

Example

catch(…)
{
     // Handle catch here.
} 

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0