Disabling Library Protection Errors for Functions

You can disable or enable library protection errors by placing pragmas in the source code. LabWindows/CVI ignores these pragmas when you compile without debugging information, that is, if you set the active configuration to a release configuration. For example, the following two pragmas enable and disable library checking for all the function declarations that occur after the pragma within a header or source file. The pragmas affect only the functions declared in the file in which the pragmas occur. These pragmas do not affect nested include files.

#pragma EnableLibraryRuntimeChecking
#pragma DisableLibraryRuntimeChecking

The following pragmas enable and disable library checking for a particular function. You must declare the function before the pragma occurs.

#pragma EnableFunctionRuntimeChecking function
#pragma DisableFunctionRuntimeChecking function

These two preceding pragmas enable and disable run-time checking for a particular library function throughout the module in which they appear. You can use these pragmas to override the effects of the EnableLibraryRuntimeChecking and DisableLibraryRuntimeChecking pragmas for individual functions. If both of these pragmas occur in a module for the same function, LabWindows/CVI uses only the last occurrence.

  • These pragmas affect all protection, including run-time checking of function arguments, for all calls to a specific library function. To disable breaking on errors for a particular call to a library function, use the Utility Library SetBreakOnLibraryErrors function. To disable the run-time checking of argument expressions for a particular call to a library function, use the Utility Library SetBreakOnProtectionErrors function.
  • You cannot use pragmas to disable protection for functions in the statically linked libraries including the User Interface, RS-232, TCP Support, DDE Support, Formatting and I/O, Utility, and ANSI C Libraries unless you place the DisableLibraryRuntimeChecking pragma at the top of the library header file.


Not Helpful