SetBreakOnFirstChanceExceptions
int SetBreakOnFirstChanceExceptions (int newState);
Purpose
If debugging is enabled, this function controls whether LabWindows/CVI displays a run-time error dialog box and suspends execution when a first chance exception occurs.
In general, use the Run»Break on»First Chance Exceptions option in the Workspace window to control this feature. Use this function when you want to temporarily disable breaking on first chance exceptions around a segment of code. SetBreakOnFirstChanceExceptions changes the setting for the thread that calls SetBreakOnFirstChanceExceptions.
Example Code
int oldValue;
oldValue = SetBreakOnFirstChanceExceptions (0);
/* function calls that may legitimately return errors */
SetBreakOnFirstChanceExceptions (oldValue);
This function does not affect the state of the Run»Break on»First Chance Exceptions option in the Workspace window.
If debugging is disabled, this function has no effect. Run-time errors are never reported when debugging is disabled. Debugging is enabled when you set the debugging level in the Build Options dialog box of the Workspace window to Standard or Extended.
Parameters
Input | ||
Name | Type | Description |
newState | int | Specifies the new break-on-first-chance-exceptions state. Specify a nonzero value or select Enabled in the function panel to display a dialog box and suspend execution when a National Instruments library function reports a first chance exception, if you enable debugging. Specify 0 or select Disabled in the function panel if you do not want to suspend execution. If you disable debugging, this parameter has no effect. |
Return Value
Name | Type | Description | ||||||
previousState | int | The previous state of the Run»Break on»First Chance Exceptions
option. When debugging is disabled, 0 is always returned.
|
Additional Information
Library: Utility Library
Include file: utility.h
LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later