/EH (Exception Handling Model)
Visual Studio .NET 2003
/EH{s|a}[c][-]
This option specifies the model of exception handling to be used by the compiler.
- Use /EHs to specify the synchronous exception handling model (C++ exception handling without structured exception handling exceptions). If you use /EHs, do not rely on the compiler to catch asynchronous exceptions.
- Use /EHa to specify the asynchronous exception handling model (C++ exception handling with structured exception handling exceptions).
The /EHc option requires that /EHs, /EHa, or /GX is specified. It tells the compiler to assume that extern C functions never throw an exception.
The option can be cleared by the symbol -. For example, /EHsc- is interpreted as /EHs /EHc-, and is equivalent to /EHs.
See Synchronous Exception Handling for more information.
To set this compiler option in the Visual Studio development environment
- Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
- Click the C/C++ folder.
- Click the Code Generation property page.
- Modify the Enable C++ Exceptions property.
Alternatively,
- Click the C/C++ folder.
- Click the Code Generation property page.
- Set Enable C++ Exceptions to No.
- Click the Command Line property page.
- Type the compiler option in the Additional Options box.
To set this compiler option programmatically
See ExceptionHandling Property.
See Also
Compiler Options | Setting Compiler Options | Exception Specifications