Chapter 1 LabWindows/CVI Compiler
LabWindows/CVI Programmer Reference Manual 1-12
©
National Instruments Corporation
• Missing terminating null in string argument
• Passing a string to a library function that expects a character reference parameter
LabWindows/CVI library functions return error codes in a variety of cases. If you enable the
Break on Library Errors option in the Run Options command in the Options menu of the
Project window, LabWindows/CVI suspends execution after a library function returns one of
these errors. A message appears that displays the name of the function and either the return
value or a string that explains why the function failed.
Disabling User Protection
Occasionally, you might want to disable user protection to avoid run-time errors that do not
cause problems in your program.
Disabling Protection Errors at Run-Time
You can use the SetBreakOnProtectionErrors function in the Utility Library to
programmatically control whether LabWindows/CVI suspends execution when it encounters
a protection error. This function does not affect the Break on Library Errors feature.
Disabling Library Errors at Run-Time
The Break on Library Errors option in the Run Options command in the Options menu of
the Project window lets you choose whether LabWindows/CVI suspends execution when a
library function returns an error code. The option takes effect when you start executing the
project. You can override the initial setting in your program by using the
SetBreakOnLibraryErrors function in the Utility Library. Use of this function does not
affect the reporting of other types of library protection errors.
Disabling Protection for Individual Pointer
You can disable pointer checking for a particular pointer by casting it first to an arithmetic
type and then back to its original type, as shown in the following macro:
#define DISABLE_RUNTIME_CHECKING(ptr)((ptr) = (void *)
((unsigned)(ptr)))
{
char *charPointer;
/* run-time checking is performed for charPointer before this
line */
DISABLE_RUNTIME_CHECKING(charPointer);
/* no run-time checking is performed for charPointer after this
line */
}
00ProRef.book : 06chap01.fm Page 12 Monday, March 9, 1998 3:23 PM