00ProRef.book : 01Title.
00ProRef.book : 01Title.fm Page 2 Monday, March 9, 1998 3:23 PM Internet Support E-mail: support@natinst.com FTP Site: ftp.natinst.com Web Address: http://www.natinst.
00ProRef.book : 02Warr.fm Page 3 Monday, March 9, 1998 3:23 PM Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation.
00ProRef.book : 00ProRefTOC.fm Page v Monday, March 9, 1998 3:23 PM Contents About This Manual Organization of This Manual ...........................................................................................xiii Conventions Used in This Manual...................................................................................xiv Related Documentation .....................................................................................xv Customer Communication..........................................
00ProRef.book : 00ProRefTOC.fm Page vi Monday, March 9, 1998 3:23 PM Contents General Protection Errors.................................................................................. 1-11 Library Protection Errors .................................................................................. 1-11 Disabling User Protection ................................................................................. 1-12 Disabling Protection Errors at Run-Time ...........................................
00ProRef.book : 00ProRefTOC.fm Page vii Monday, March 9, 1998 3:23 PM Contents Run State Change Callbacks in DLLs ...............................................................3-2 DllMain..............................................................................................................3-3 Releasing Resources when a DLL Unloads ......................................................3-3 Generating an Import Library............................................................................
00ProRef.book : 00ProRefTOC.fm Page viii Monday, March 9, 1998 3:23 PM Contents Borland C++ Builder......................................................................................... 3-17 Watcom Pull-in References .............................................................................. 3-17 Creating Object and Library Files in External Compilers for Use in LabWindows/CVI.....................................................................................................
00ProRef.book : 00ProRefTOC.fm Page ix Monday, March 9, 1998 3:23 PM Contents DLL Glue Code .................................................................................................4-7 DLLs That Can Use Glue Code Generated at Load Time ..................4-8 DLLs That Cannot Use Glue Code Generated at Load Time .............4-8 Loading a DLL That Cannot Use Glue Code Generated at Load Time ....................................................................................
00ProRef.book : 00ProRefTOC.fm Page x Monday, March 9, 1998 3:23 PM Contents Solaris 1 ANSI C Library Implementation...................................................................... 5-8 Replacement Functions ..................................................................................... 5-9 Additional Functions Not Found in Sun Solaris 1 libc ..................................... 5-9 Incompatibilities among LabWindows/CVI, Sun Solaris, and ANSI C .........................
00ProRef.book : 00ProRefTOC.fm Page xi Monday, March 9, 1998 3:23 PM Contents Message, Resource, and Font Files.....................................................7-11 National Instruments Hardware I/O Libraries ....................................7-11 LabWindows/CVI Run-Time Engine under Windows 3.1 ...............................7-11 LabWindows/CVI Run-Time Engine under Sun Solaris ..................................7-12 Rules for Accessing UIR, Image, and Panel State Files on All Platforms........
00ProRef.book : 00ProRefTOC.fm Page xii Monday, March 9, 1998 3:23 PM Contents ActiveX Automation Library ............................................................................ 9-6 X Property Library ............................................................................................ 9-6 Formatting and I/O Library............................................................................... 9-6 Utility Library .................................................................................
00ProRef.book : 05atm.fm Page xiii Monday, March 9, 1998 3:23 PM About This Manual The LabWindows/CVI Programmer Reference Manual contains information to help you develop programs in LabWindows/CVI. The LabWindows/CVI Programmer Reference Manual is intended for use by LabWindows users who have already completed the Getting Started with LabWindows/CVI tutorial.
00ProRef.book : 05atm.fm Page xiv Monday, March 9, 1998 3:23 PM About This Manual • Chapter 7, Creating and Distributing Standalone Executables and DLLs, describes how the LabWindows/CVI Run-time Engine, DLLs, externally compiled modules, and other files interact with your executable file. This chapter also describes how to perform error checking in a standalone executable program. You can create executable programs from any project that runs in the LabWindows/CVI environment.
00ProRef.book : 05atm.fm Page xv Monday, March 9, 1998 3:23 PM About This Manual This icon to the left of bold italicized text denotes a note, which alerts you to important information. ! This icon to the left of bold italicized text denotes a caution, which advises you of precautions to take to avoid injury, data loss, or a system crash. bold Bold text denotes the names of menus, menu items, parameters, or dialog box buttons.
00ProRef.book : 05atm.fm Page xvi Monday, March 9, 1998 3:23 PM About This Manual Customer Communication National Instruments wants to receive your comments on our products and manuals. We are interested in the applications you develop with our products, and we want to help you if you have problems with them. To make it easy for you to contact us, this manual contains comment and technical support forms for you to complete. These forms are in Appendix B, Customer Communication, at the end of this manual.
00ProRef.book : 06chap01.fm Page 1 Monday, March 9, 1998 3:23 PM LabWindows/CVI Compiler 1 This chapter describes LabWindows/CVI compiler specifics, C language extensions, 32-bit compiler issues, debugging levels, and user protection. Overview The LabWindows/CVI compiler is a 32-bit ANSI C compiler. The kernel of the LabWindows/CVI compiler is the lcc ANSI C compiler (© Copyright 1990, 1991, 1992, 1993 David R. Hanson).
00ProRef.book : 06chap01.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler Compiler Options You can set the LabWindows/CVI compiler options by selecting Options»Compiler Options in the Project window. This command opens a dialog box that allows you to set LabWindows/CVI compiler options. For a discussion of these options, refer to the Compiler Options section in Chapter 3, Project Window, of the LabWindows/CVI User Manual.
00ProRef.book : 06chap01.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler however, set options to cause the calling convention to default to __stdcall. The behavior is the same in LabWindows/CVI. You can set the default calling convention to either __cdecl or __stdcall using the Compiler Options command in the Options menu of the Project window. When you create a new project, the default calling convention is __cdecl.
00ProRef.book : 06chap01.fm Page 4 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler At this time, not all these qualifiers work in all external compilers. The LabWindows/CVI cvidef.h include file defines the following macros, which are designed to work in each external compiler. DLLIMPORT DLLEXPORT An import qualifier informs the compiler that the symbol is defined in a DLL. Declarations of variables imported from a DLL require import qualifiers, but function declarations do not.
00ProRef.book : 06chap01.fm Page 5 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler You can set the maximum alignment as follows: #pragma pack(4) /* sets maximum alignment to 4 bytes */ #pragma pack(8) /* sets maximum alignment to 8 bytes */ #pragma pack() /* resets to the default*/ The maximum alignment the compiler applies to a structure is based on the last pack pragma statement it sees before the definition of the structure.
00ProRef.book : 06chap01.fm Page 6 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler C Data Types and 32-Bit Compiler Issues This section introduces the LabWindows/CVI compiler data types and discusses converting 16-bit source code to 32-bit source code. Data Types Table 1-2 shows the LabWindows/CVI allowable data types. Table 1-2.
00ProRef.book : 06chap01.fm Page 7 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler For example, the code int x; declares a 2-byte integer in a 16-bit compiler such as LabWindows for DOS. In contrast, a 32-bit compiler such as LabWindows/CVI handles this code as a declaration of a 4-byte integer. In most cases, this does not cause a problem and the conversion is transparent, because functions that use 2-byte integers in LabWindows for DOS use 4-byte integers in LabWindows/CVI.
00ProRef.book : 06chap01.fm Page 8 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler Debugging Levels You can compile the source modules in your application to include debugging information. If you do so, you can use breakpoints and view or modify variables and expressions while your program is suspended. You set the debugging level by selecting Options»Run Options in the Project window.
00ProRef.book : 06chap01.fm Page 9 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler invalid or when the arithmetic operation results in an invalid pointer expression.
00ProRef.book : 06chap01.fm Page 10 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler • Dereference of a pointer to an n-byte type where less than n bytes exist in the object • Dereference of unaligned pointer (UNIX only) Pointer Comparison (Non-Fatal) LabWindows/CVI generates pointer comparison errors for erroneous pointer comparison expressions.
00ProRef.book : 06chap01.fm Page 11 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler Dynamic Memory Protection Errors Dynamic memory protection errors report illegal operations with dynamic memory and corrupted dynamic memory during allocation and deallocation. Memory Deallocation (Non-Fatal) LabWindows/CVI generates memory deallocation errors when the pointer is not the result of a memory allocation.
00ProRef.book : 06chap01.fm Page 12 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler • 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.
00ProRef.book : 06chap01.fm Page 13 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler This macro could be useful in the following situation: LabWindows/CVI reports erroneous run-time errors because you set a pointer to dynamic memory in a source module and you then resize it in an object module. The following steps describe how this error occurs: 1. You declare a pointer in a source module you compile with debugging enabled.
00ProRef.book : 06chap01.fm Page 14 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler These two pragmas enable and disable run-time checking for a particular library function throughout the module in which they appear. You can use them 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.
00ProRef.book : 06chap01.fm Page 15 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler Dynamic Memory LabWindows/CVI provides run-time error checking for pointers and arrays in dynamically allocated memory. You can use the ANSI C library functions malloc or calloc to allocate dynamic memory. These functions return void * values that you must cast to some other type before the memory can be used.
00ProRef.book : 06chap01.fm Page 16 Monday, March 9, 1998 3:23 PM Chapter 1 LabWindows/CVI Compiler Library Functions The LabWindows/CVI library functions that take pointer arguments or that return pointers incorporate run-time checking for those arguments and return values. However, you must be careful when passing arguments to library functions that have void * parameters, such as GetCtrlAttribute and GetCtrlVal in the User Interface Library and memcpy and memset in the ANSI C library.
00ProRef.book : 06chap01.fm Page 17 Monday, March 9, 1998 3:23 PM Chapter 1 Note LabWindows/CVI Compiler For LabWindows/CVI for Windows 3.1, the actual stack size approaches 64 KB when you set the Debugging level to None. Include Paths The Include Paths command in the Options menu of the Project window specifies the directory search path for include files. The Include Paths dialog box has two lists, one for include paths specific to the project, and one for paths not specific to the project.
00ProRef.book : 06chap02.fm Page 1 Monday, March 9, 1998 3:23 PM 2 Using Loadable Compiled Modules This chapter describes the advantages and disadvantages of using compiled code modules in your application. It also describes the kinds of compiled modules available in LabWindows/CVI and includes programming guidelines for modules you generate with external compilers. Refer to Chapter 3, Windows 95/NT Compiler/Linker Issues, Chapter 4, Windows 3.
00ProRef.book : 06chap02.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 2 Using Loadable Compiled Modules Advantages and Disadvantages of Using Loadable Compiled Modules in LabWindows/CVI Using compiled modules in LabWindows/CVI has the following advantages: • Compiled modules run faster than source modules. Compiled modules do not contain the debugging and user protection code LabWindows/CVI generates when it compiles source modules.
00ProRef.book : 06chap02.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 2 Using Loadable Compiled Modules If the instrument driver program file is a compiled module, it must adhere to the requirements outlined for each operating system in Chapter 3, Windows 95/NT Compiler/Linker Issues, Chapter 4, Windows 3.1 Compiler/Linker Issues, and Chapter 5, UNIX Compiler/Linker Issues, of this manual. Using a Loadable Compiled Module as a User Library You can install your own libraries into the Library menu.
00ProRef.book : 06chap02.fm Page 4 Monday, March 9, 1998 3:23 PM Chapter 2 Using Loadable Compiled Modules Compiled modules must adhere to the requirements outlined for the target operating system. Chapter 3, Windows 95/NT Compiler/Linker Issues, Chapter 4, Windows 3.1 Compiler/Linker Issues, and Chapter 5, UNIX Compiler/Linker Issues, of this manual, discuss operating system requirements.
00ProRef.book : 06chap02.fm Page 5 Monday, March 9, 1998 3:23 PM Chapter 2 Using Loadable Compiled Modules kRunState_EnableCallbacks, kRunState_DisableCallbacks }; The following examples show typical program state changes. Example 1 kRunState_Start kRunState_EnableCallbacks /* user program execution begins */ . . .
00ProRef.book : 06chap02.fm Page 6 Monday, March 9, 1998 3:23 PM Chapter 2 Using Loadable Compiled Modules Example 2 kRunState_Start kRunState_EnableCallbacks /* user program execution begins */ . . . /* a breakpoint or run-time error occurs, or user presses the Terminate Execution key combination */ kRunState_DisableCallbacks kRunState_Suspend /* program execution suspends; CVI environment resumes */ . . .
00ProRef.book : 06chap02.fm Page 7 Monday, March 9, 1998 3:23 PM Chapter 2 Using Loadable Compiled Modules Windows 95/NT unloads DLLs at process termination is not well-defined. Therefore, the DLL you call into might no longer be loaded. This can cause a general protection fault. Nevertheless, when you use your DLL in a program in the LabWindows/CVI development environment, it is often necessary to call into DLLs to release resources after each run.
00ProRef.book : 06chap03.fm Page 1 Monday, March 9, 1998 3:23 PM 3 Windows 95/NT Compiler/Linker Issues This chapter describes the different kinds of compiled modules available under LabWindows/CVI for Windows 95/NT and includes programming guidelines for modules you generate with external compilers. Under Windows 95/NT, the LabWindows/CVI compiler is compatible with four external 32-bit compilers: Microsoft Visual C/C++, Borland C/C++, Watcom C/C++, and Symantec C/C++.
00ProRef.book : 06chap03.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues DLLs for Instrument Drivers and User Libraries Under Windows 95/NT, LabWindows/CVI does not directly associate DLLs with instrument drivers or user libraries. However, LabWindows/CVI can associate instrument drivers and user libraries with DLL import libraries. Each DLL must have a DLL import library (.lib) file.
00ProRef.book : 06chap03.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues callback in a DLL, you must take special care. Refer to the Notification of Changes in Run State section in Chapter 2, Using Loadable Compiled Modules, of this manual, for a detailed discussion of run state change callbacks. DllMain Each DLL can have a DllMain function, except that the Borland compiler uses DllEntryPoint as the name.
00ProRef.book : 06chap03.fm Page 4 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Note cvirte.dll contains the User Interface, Utility, Formatting and I/O, RS-232, ANSI C, TCP, and DDE Libraries. Generating an Import Library If you do not have a DLL import library or if the one you have contains references the DLL does not export, you can generate an import library in LabWindows/CVI.
00ProRef.book : 06chap03.fm Page 5 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Choosing Your Compatible Compiler When installing LabWindows/CVI, you must choose your compatible compiler. If you want to change your choice of compatible compiler later, you can run the installation program and change to another compatible compiler.
00ProRef.book : 06chap03.fm Page 6 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Structure Packing The compilers differ in their default maximum alignment of elements within structures. If your DLL API uses structures, you can guarantee compatibility among the different compilers by using the pack pragma to specify a specific maximum alignment factor. Place this pragma in the DLL include file, before the definitions of the structures. You can choose any alignment factor.
00ProRef.book : 06chap03.fm Page 7 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Returning Floats and Doubles The compilers return float and double scalar values using different mechanisms. This is true of all calling conventions, including __stdcall. The only solution for this problem is to change your DLL API so that it uses output parameters instead of return values for double and float scalars.
00ProRef.book : 06chap03.fm Page 8 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues originally developed under one of these external compilers to LabWindows/CVI, you might have to manually define one of these macros. External Compiler Versions Supported The following versions of each external compiler work with LabWindows/CVI for Windows 95/NT: • Microsoft Visual C/C++, version 2.2 or higher • Borland C/C++, version 4.51 or higher • Watcom C/C++, version 10.
00ProRef.book : 06chap03.fm Page 9 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Using LabWindows/CVI Libraries in External Compilers Under Windows 95/NT, you can use the LabWindows/CVI libraries in any of the four compatible external compilers. You can create executables and DLLs that call the LabWindows/CVI libraries. LabWindows/CVI ships with the run-time DLLs that contain all the libraries. Executable files you create in LabWindows/CVI also use these DLLs.
00ProRef.book : 06chap03.fm Page 10 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues If you use an external compiler that requires a WinMain entry point, the following optional library allows you to define only main in your program. cviwmain.lib /* contains a WinMain() function which */ /* calls main() */ Include Files for the ANSI C Library and the LabWindows/CVI Libraries The cvirt.
00ProRef.book : 06chap03.fm Page 11 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues When you link your program in an external compiler, the external compiler does not make such a table available to the User Interface Library. To resolve callback references, you must use LabWindows/CVI to generate an object file that contains the necessary table. 1. Create a LabWindows/CVI project that contains the .uir files your program uses, if you do not already have one. 2.
00ProRef.book : 06chap03.fm Page 12 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues 4. Include this object file in the external compiler project you use to create the DLL. 5. You must call InitCVIRTE and CloseCVIRTE in your DLLMain function. Refer to the Calling InitCVIRTE and CloseCVIRTE section later in this chapter.
00ProRef.book : 06chap03.fm Page 13 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues module references any of the commonly used Windows SDK functions, you can use the cvi\sdk\include\basicsdk.h file. Execute the External Compiler Support command in the Build menu of the Project window. A dialog box appears. Enable the Using Load External Module option. Enable the Other Symbols checkbox if it is not already enabled.
00ProRef.book : 06chap03.fm Page 14 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues resources your program allocated, but your compiled module might have to do more. Also, if the program suspends for debugging purposes, your compiled module might have to disable interrupts. When you run an executable created in an external compiler, it always executes as a separate process, even when you debug it.
00ProRef.book : 06chap03.fm Page 15 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues For a DLL, you also have to call CloseCVIRTE in DLLMain. The code must include the following segment: #include
00ProRef.book : 06chap03.fm Page 16 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues default library directive, and the linker does not explicitly include a C library in the link, the linker reports unresolved function references in the object modules. Object and static library files that LabWindows/CVI creates do not contain a default library directive. This has different implications for each compiler.
00ProRef.book : 06chap03.fm Page 17 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Borland Static versus Dynamic C Libraries When you link a Borland C/C++ project that contains object or static library files you create in LabWindows/CVI, it is a good idea to configure the Borland project to use the static version of the Borland C libraries. If you choose to use the dynamic C libraries, you must compile the LabWindows/CVI object modules with the _RTLDLL macro.
00ProRef.book : 06chap03.fm Page 18 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Creating Object and Library Files in External Compilers for Use in LabWindows/CVI When you use a compatible external compiler to create an object or library file for use in LabWindows/CVI, you must use the include files in the cvi\include and cvi\sdk\include directories.
00ProRef.book : 06chap03.
00ProRef.book : 06chap03.fm Page 20 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Creating Executables in LabWindows/CVI You can create true 32-bit Windows executables in LabWindows/CVI for Windows 95/NT. In LabWindows/CVI for Windows 3.1, you run standalone programs using a special executable file that contains the LabWindows/CVI run-time libraries. If you run more than one program at a time, Windows 3.1 loads extra copies of this special executable into memory.
00ProRef.book : 06chap03.fm Page 21 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues To customize an import library, you must have an include file that contains the declarations of all the functions you want to export from the DLL. Load the include file into a Source window, and execute the Generate DLL Import Source command in the Options menu. After you have generated the import source, you can modify it, including making calls to functions in other source files.
00ProRef.book : 06chap03.fm Page 22 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues project. You must use the __stdcall keyword in the declarations in the include file you distribute with the DLL. Other platforms, such as UNIX or Windows 3.1 do not recognize the __stdcall keyword. If you work with source code that you might use on other platforms, you must use a macro in place of __stdcall. The cvidef.h include file defines the DLLSTDCALL macro for this purpose.
00ProRef.book : 06chap03.fm Page 23 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues macro to resolve differences among compilers and platforms.
00ProRef.book : 06chap03.fm Page 24 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues You can solve these problems in several different ways: • You can avoid exporting variables from DLLs, and thereby eliminate the need to use import qualifiers. For each variable you want to export, you can create functions to get and set its value or a function to return a pointer to the variable. You do not have to use import qualifiers for functions.
00ProRef.book : 06chap03.fm Page 25 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues If your function panel file contains help text, you can generate a Windows help file from it using the Generate Windows Help command in the Options menu of the Function Tree Editor window. The Create Dynamic Link Library command provides an option to include links into the Window help file in the Type Library.
00ProRef.book : 06chap03.fm Page 26 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Creating Object Files in LabWindows/CVI You can create an object file in LabWindows/CVI in one of two ways: • Include a source (.c) file in your project. Enable the Compile into Object option for the source file by double-clicking in the space next to the filename in the Project window under the column marked “O”. Compile the file. • Open a source (.
00ProRef.book : 06chap03.fm Page 27 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues include files. For more information, refer to the Setting Up Include Paths for LabWindows/CVI, ANSI C, and SDK Libraries section later in this chapter. The number of SDK include files is very large. Normally, you have to include only windows.h because it includes many, but not all, of the other include files. The inclusion of windows.
00ProRef.book : 06chap03.fm Page 28 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues If the LabWindows/CVI linker reports SDK functions as unresolved references, you must add import libraries to your project. Refer to the cvi\sdk\sdkfuncs.txt file for associations of SDK import libraries to SDK functions. The import libraries are in the cvi\sdk\lib directory.
00ProRef.book : 06chap03.fm Page 29 Monday, March 9, 1998 3:23 PM Chapter 3 Windows 95/NT Compiler/Linker Issues Compiling in an External Compiler for Linking in LabWindows/CVI Use the LabWindows/CVI SDK and ANSI C include files. Specify the following directories as include paths in the external compiler. cvi\include cvi\include\ansi cvi\sdk\include Handling Hardware Interrupts under Windows 95/NT Under Windows 3.1, you can handle hardware interrupts in a DLL.
00ProRef.book : 06chap04.fm Page 1 Monday, March 9, 1998 3:23 PM 4 Windows 3.1 Compiler/Linker Issues This chapter describes the different kinds of compiled modules available under LabWindows/CVI for Windows 3.1 and includes programming guidelines for modules you generate with external compilers. Using Modules Compiled by LabWindows/CVI You can generate a compiled .obj or .o module from a source file within LabWindows/CVI using the Create Object File command in the Options menu of a Source window.
00ProRef.book : 06chap04.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues keywords such as far, near, or huge in the declaration of functions to be called from LabWindows/CVI source code. • If your Watcom-compiled module performs floating point operations, you must use Watcom Version 9.5 or later. • Use the following options when you compile with Watcom IDE: • – Set the Project Target Environment to 32-bit Windows 3.x, and set the Image Type to Library [.lib].
00ProRef.book : 06chap04.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues • ANSI C library functions div and ldiv return structures, and hence you cannot call them from Borland compiled modules. • The type long double is the same as double in CVI, while in Borland it is 10 bytes long, so you cannot share objects of this type between Borland and CVI modules.
00ProRef.book : 06chap04.fm Page 4 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues You must observe certain rules and restrictions in a DLL you want to use with LabWindows/CVI. If you experience problems using a DLL in LabWindows/CVI, you might have to contact the developer of the DLL to obtain modifications. Because LabWindows/CVI is a 32-bit application, special glue code is required to communicate with a 16-bit DLL.
00ProRef.book : 06chap04.fm Page 5 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues • You can use the argument types char, unsigned char, int, unsigned int, short, unsigned short, long, unsigned long, float, and double, as well as pointers to any type, and arrays of any type. You can use typedefs for these types. • You can use the return types void, char, unsigned char, int, unsigned int, short, unsigned short, long, and unsigned long, as well as pointers to any type.
00ProRef.book : 06chap04.fm Page 6 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues regs.x.si = HIWORD(size); int86(0x31, ®s, ®s); return regs.x.cflag; } After the DMA is complete, you must unlock the buffer. You can unlock the buffer using the DPMILock function, if you set regs.x.ax to 0x601, instead of 0x600. • If you compile the DLL with the /FPi or /FPc switches or with no /FP switches (/FPi is the default), the DLL uses the WIN87EM.DLL floating point emulator.
00ProRef.book : 06chap04.fm Page 7 Monday, March 9, 1998 3:23 PM Chapter 4 /* perform the computations . . . /* restore the floating point state _FPTerm (OldFPHandler); Windows 3.1 Compiler/Linker Issues */ */ } Note If you use Microsoft C to build the DLL, you might get a linker error for an undefined symbol _acrtused2. This error occurs only in Microsoft C versions 7.00 and later. Include the following dummy function in your DLL to fix this error. Also, when linking to the DLL, specify WIN87EM.
00ProRef.book : 06chap04.fm Page 8 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues DLLs That Can Use Glue Code Generated at Load Time If your DLL can use glue code generated at load time, LabWindows/CVI automatically generates the glue code based on the contents of the .h file it associates with the DLL when it loads it. Any functions declared as PASCAL, pascal, or _pascal in the DLL should be declared as PASCAL in the .h file.
00ProRef.book : 06chap04.fm Page 9 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues Also, you can create a .pth file in the same directory as the .obj or .lib file with the same base name. The .pth file must contain a simple filename or a full pathname of the DLL. If it is a simple filename, LabWindows/CVI uses the standard Windows DLL search algorithm. Rules for the DLL Include File Used to Generate Glue Source You can generate the DLL glue source file by opening the .
00ProRef.book : 06chap04.fm Page 10 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues In the glue code generated by LabWindows/CVI, there is a declaration of WriteRealArray like that shown in the following example.
00ProRef.book : 06chap04.fm Page 11 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues You must also modify the call to GetIndirectFunctionHandle for WriteRealArray as shown in the following code: if (!(__static_WriteRealArray = GetIndirectFunctionHandle (fp, INDIR_PTR, INDIR_WORD, INDIR_ENDLIST))) by changing INDIR_PTR to INDIR_DWORD.
00ProRef.book : 06chap04.fm Page 12 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.
00ProRef.book : 06chap04.fm Page 13 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues You cannot pass pointers to 32-bit functions directly into 16-bit DLLs. The Windows SDK interface for this is very complex. Generate DLL Glue Source does not generate this code for you. You must write your own glue code for passing function pointers to and from a DLL, and add it to the file that Generate DLL Glue Source generates.
00ProRef.book : 06chap04.fm Page 14 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues static long FAR CallbackHelper(long data) { return (*UsersCallback)(data); } /* Modified glue code for the function that installs the /* callback. long InstallCallback(long (*callback)(long)) { long retval; unsigned short cw387; */ */ UsersCallback = callback; /* Store CVI 32-bit pointer /* in static variable.
00ProRef.book : 06chap04.fm Page 15 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues failed: FreeCallbackResources(); return FALSE; } /* Call this function after unregistering the callback. */ void FreeCallbackResources(void) { if (CallbackData.proc16Instance) { FreeProcInstance(CallbackData.proc16Instance); CallbackData.proc16Instance = 0; } if (CallbackData.proc16) { ReleaseProc16(CallbackData.proc16); CallbackData.proc16 = 0; } if (CallbackData.
00ProRef.book : 06chap04.fm Page 16 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.
00ProRef.book : 06chap04.fm Page 17 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.
00ProRef.book : 06chap04.fm Page 18 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.
00ProRef.book : 06chap04.fm Page 19 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues cw387 = Get387CW(); retval = (int) InvokeIndirectFunction(__static_g, ptr); Set387CW(cw387); return retval; } After you make the necessary changes, the code should appear as follows: /* Assume NUM_ELEMENTS is the number of pointers in the input /* array. Assume ITEM_SIZE is the number of bytes pointed /* to by each pointer.
00ProRef.book : 06chap04.fm Page 20 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.
00ProRef.book : 06chap04.fm Page 21 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues Recognizing Windows Messages Passed from a DLL The normal way of communicating with a DLL is to call functions in the DLL. However, cases exist where other communication methods are necessary. The most typical case is that of an interrupt service routine in a DLL that must notify the application that the interrupt occurred.
00ProRef.book : 06chap04.fm Page 22 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues /Au option. You can either not use this option by setting it to None, or insert __loadds in front of every function you export from the DLL. • You can make the compiler export a function by inserting __export between the return type and the function name, or by adding the function name to the exports section of the .def file. • If you add the function name to the exports section of the .
00ProRef.book : 06chap04.fm Page 23 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues DLL Search Precedence LabWindows/CVI finds a DLL file in the following ways for Windows 3.1: • If the .dll file is associated with a .fp file, LabWindows/CVI uses the following search precedence to find the DLL. 1. If a .pth file with the same full path name as the .fp file is in the project, LabWindows/CVI uses the standard Windows DLL search algorithm. The .
00ProRef.book : 06chap04.fm Page 24 Monday, March 9, 1998 3:23 PM Chapter 4 Windows 3.1 Compiler/Linker Issues • If you call LoadExternalModule on the .dll file, then – If you specify it with an absolute pathname, LabWindows/CVI loads that file. – If you specify it with a relative pathname, LabWindows/CVI searches for the .dll file in the following places and order indicated. 1. In the project list. 2. In the directory in which the project file is located. 3. Among other modules already loaded.
00ProRef.book : 06chap05.fm Page 1 Monday, March 9, 1998 3:23 PM UNIX Compiler/Linker Issues 5 This chapter describes the kinds of compiled modules available under LabWindows/CVI for UNIX and includes programming guidelines for modules you generate with external compilers. Calling Sun C Library Functions You can call functions in the Sun Solaris C libraries from source code in LabWindows/CVI.
00ProRef.book : 06chap05.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues Using Shared Libraries in LabWindows/CVI In the LabWindows/CVI development environment, you can link your programs to static libraries, but not to shared libraries. If you have to use a shared library, you must use the Sun Solaris linker (ld) to build your application.
00ProRef.book : 06chap05.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues Creating Executables that Use the LabWindows/CVI Libraries You can build executables that use the LabWindows/CVI libraries in two ways: • You can build an executable in the LabWindows/CVI development environment by selecting the Create Standalone Executable command in the Build menu of the Project window.
00ProRef.book : 06chap05.fm Page 4 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues Non-ANSI Behavior of Sun Solaris 1 ANSI C Library The C library that comes with Sun Solaris 1 (SunOS 4.1.x) does not comply with the ANSI C standard as follows: • Some ANSI C functions are missing from the library. • Some library functions have different behavior than the ANSI standard specifies. LabWindows/CVI corrects these problems by adding a library, libcfix.
00ProRef.book : 06chap05.fm Page 5 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues National Instruments recommends that you always include source code similar to the following example in your program.
00ProRef.book : 06chap05.fm Page 6 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues Using Externally Compiled Modules In general, you can load objects compiled with the Sun compilers and the GNU gcc compiler into LabWindows/CVI, with a few restrictions. Restrictions on Externally Compiled Modules You can use externally compiled modules with the following restrictions: • The objects must not use any data types that are incompatible with the LabWindows/CVI compiler or libraries.
00ProRef.book : 06chap05.fm Page 7 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues You cannot use the non-ANSI C Sun compiler cc because it does not recognize some ANSI C constructs in the header files, such as function prototypes and the keywords const, void, and volatile. Locking Process Segments into Memory Using plock() You can use the UNIX function plock to lock the text and data segments of your program into memory.
00ProRef.book : 06chap05.fm Page 8 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues and suspends operation at the statement that caused the exception. If this signal occurs when no program is running, LabWindows/CVI exits immediately. You cannot use signal, sigaction, sigset, or sigvec to make your program ignore the signals this section lists.
00ProRef.book : 06chap05.fm Page 9 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues contains the following macro definition so that _cvi_realloc replaces all references to realloc in your program. #define realloc _cvi_realloc Note Object files you previously compiled using either older LabWindows/CVI headers or Sun Solaris headers do not reference the replacement functions. You must recompile your object files using LabWindows/CVI headers to obtain ANSI-compliant behavior.
00ProRef.book : 06chap05.fm Page 10 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues Incompatibilities among LabWindows/CVI, Sun Solaris, and ANSI C Under the ANSI C standard, the programmer who implements the library chooses how certain functions behave. As a result, two implementations of a function can behave differently and still conform to the ANSI standard.
00ProRef.book : 06chap05.fm Page 11 Monday, March 9, 1998 3:23 PM Chapter 5 UNIX Compiler/Linker Issues of setlocale. In contrast, LabWindows/CVI links standalone executables to the shared library libc.so, which contains the fully functional version of setlocale. Between LabWindows/CVI and Sun Solaris The following incompatibilities exist between LabWindows/CVI and Sun Solaris: • LabWindows/CVI does not support the long long data type some header files on Solaris 2 use.
00ProRef.book : 06chap06.fm Page 1 Monday, March 9, 1998 3:23 PM 6 Building Multiplatform Applications This chapter contains guidelines and caveats for writing platform-independent LabWindows/CVI applications. LabWindows/CVI currently runs under Windows 3.1 and Windows 95/NT for the PC, and Solaris 1 and Solaris 2 for the SPARCstation. One major feature of LabWindows/CVI is that it supports multiplatform programming.
00ProRef.book : 06chap06.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 6 Building Multiplatform Applications Low-Level I/O Functions section in Chapter 1, LabWindows/CVI Compiler, of this manual, for more information on how to use system library calls. Under UNIX, the low-level I/O functions open, close, read, write, lseek, and eof are available in the UNIX C library.
00ProRef.book : 06chap06.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 6 Building Multiplatform Applications Externally Compiled Modules Although you can use externally compiled modules in LabWindows/CVI as this manual describes, the best medium for application portability is ANSI C source code. Object modules are not directly portable from one platform to another because the object file formats on the various platforms differ. For example, the object file formats are different among Windows 3.
00ProRef.book : 06chap07.fm Page 1 Monday, March 9, 1998 3:23 PM 7 Creating and Distributing Standalone Executables and DLLs This chapter describes how the LabWindows/CVI Run-time Engine, DLLs, externally compiled modules, and other files interact with your executable file. This chapter also describes how to perform error checking in a standalone executable program. You can create executable programs from any project that runs in the LabWindows/CVI environment.
00ProRef.book : 06chap07.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs No Math Coprocessor Required for Windows 95/NT You do not have to have a math coprocessor or emulator to use the LabWindows/CVI Run-time Engine under Windows 95/NT. Minimum System Requirements for Windows 3.1 To run a standalone executable you create using LabWindows/CVI for Windows, you must have the following: • MS-DOS, version 3.
00ProRef.book : 06chap07.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Distributing Standalone Executables under Solaris 2 To use the System V software packaging utility pkgmk to distribute executable programs under Solaris 2, complete the following steps. 1. If your program loads .uir files with LoadPanel or loads external modules with LoadExternalModule, use caution when you specify the filenames in calls to these functions.
00ProRef.book : 06chap07.fm Page 4 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs makecvirte script prompts you to name the directory in which to place the completed package. The package name is NICcvirte. 6. To install or remove a package on a machine you must log in as root.
00ProRef.book : 06chap07.fm Page 5 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Minimum System Requirements for UNIX To run a standalone executable you create using LabWindows/CVI for UNIX, your system must have the following: • Sun SPARCstation • Solaris 1.x (SunOS 4.1.2 or higher) or Solaris 2.
00ProRef.book : 06chap07.fm Page 6 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs the patch. The required patches are available in the misc/patch subdirectory of the LabWindows/CVI installation directory. The following patches are available: • Patch-ID #100257-06 for SunOS 4.1.3/4.1.3c • Patch-ID #101743-02 for SunOS 4.1.3_U1 • Patch-ID #101783-02 for SunOS 4.1.1/4.1.
00ProRef.book : 06chap07.fm Page 7 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs cvidir (Windows Only) Under Windows 95/NT, cvidir specifies the location of the directory that contains the bin and fonts subdirectories that the Run-time Engine requires. This Registry entry is necessary to enable the Windows 95/NT Run-time Engine DLL to load.
00ProRef.book : 06chap07.fm Page 8 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Necessary Files for Running Executable Programs In order for your executable to run successfully on a target computer, all files the executable requires must be accessible. Your final distribution kit must contain all the necessary files to install your LabWindows/CVI executable program on a target machine as shown in Figure 7-1.
00ProRef.book : 06chap07.fm Page 9 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Windows 95/NT, the Run-time Engine consists of multiple files, including three DLLs and the low-level support driver. Under Windows 3.1, the Run-time Engine is an execute-only version of the LabWindows/CVI environment. Under Sun Solaris, the Run-time Engine is a shared library • UIR files—The User Interface Resource files that your application program uses.
00ProRef.book : 06chap07.fm Page 10 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs LabWindows/CVI Run-Time Engine under Windows 95/NT Table 7-1 shows the files that comprise the LabWindows/CVI Run-time Engine for Windows 95/NT. Table 7-1. LabWindows/CVI Run-Time Engine Files Run-Time Engine File Description cvirt.dll Helper DLL cvirte.dll Contains most LabWindows/CVI libraries cviauto.dll Contains ActiveX Automation Library cvi95vxd.
00ProRef.book : 06chap07.fm Page 11 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Windows NT. Under Windows NT, the installation program also adds a registry entry under the following key: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\cvintdrv Table 7-2 shows the values the installation program sets for the Windows NT registry entry for the low-level support driver. Table 7-2.
00ProRef.book : 06chap07.fm Page 12 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs the Run-time Engine into your distribution kit. Also, you can make copies of this diskette for separate distribution. The user selects the directory into which to install the Run-time Engine. The LabWindows/CVI Run-time Engine does not include the DLLs or drivers for National Instruments hardware.
00ProRef.book : 06chap07.fm Page 13 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Rules for Using DLL Files under Windows 95/NT Under Windows 95/NT, your executable or DLL can link to a DLL only through an import library. This section refers to a DLL an executable or another DLL uses as a subsidiary DLL. You can link an import library into your program in any of the following ways: • List it in your project. • Associate it with the .
00ProRef.book : 06chap07.fm Page 14 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Do not include DLLs for National Instruments hardware in your distribution kit. The user must install these DLLs from the distribution disks that National Instruments supplies. If you use LoadExternalModule to load DLLs, refer to the following section, Rules for Loading Files Using LoadExternalModule.
00ProRef.book : 06chap07.fm Page 15 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Forcing Modules that External Modules Refer to into Your Executable or DLL In the LabWindows/CVI development environment, external modules can link to modules in the Instrument and Library menus regardless of whether you refer to them elsewhere in your project.
00ProRef.book : 06chap07.fm Page 16 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs • • If you want to force only specific modules from the library into the executable, reference them statically in your program. For example, you could have an array of void pointers and initialize them to the names of the necessary symbols.
00ProRef.book : 06chap07.fm Page 17 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Using LoadExternalModule on DLL Files under Windows 95/NT Under Windows 95/NT, you cannot pass the pathname of a DLL directly into LoadExternalModule. Instead, you must pass the pathname of a DLL import library. You can link the import library into your executable or DLL or distribute it separately and load it dynamically.
00ProRef.book : 06chap07.fm Page 18 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs current working directory, \windows, \windows\system, then the PATH environment variable. 2. Look for a .dll file in the directory of the executable. The .dll file must have the same base name as the file you passed to LoadExternalModule. 3. Otherwise, use the standard Windows DLL search algorithm.
00ProRef.book : 06chap07.fm Page 19 Monday, March 9, 1998 3:23 PM Chapter 7 Creating and Distributing Standalone Executables and DLLs Rules for Accessing Other Files The functions for accessing files, such as fopen, OpenFile, SetFileAttrs, DeleteFile, and so on, interpret relative pathnames as being relative to the current working directory. Under Windows, the initial current working directory is normally the directory of the executable.
00ProRef.book : 06chap08.fm Page 1 Monday, March 9, 1998 3:23 PM 8 Distributing Libraries and Function Panels This chapter describes how to distribute libraries, add libraries to a user’s Library menu, and specify library dependencies. How to Distribute Libraries You can distribute libraries for other users to include in their Library menu. You must create a function panel (.fp) for each library program file. If you do not want to develop function panels for the library functions, create a .
00ProRef.book : 06chap08.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 8 Distributing Libraries and Function Panels To add the libraries to the user’s Library menu under Windows 3.1 and UNIX, your modini command file must be: add Libraries LibraryFPFile "c:\newlib\lib1.fp" add Libraries LibraryFPFile "c:\newlib\lib2.fp" After the user installs the library files, the modini program must be run on the user’s disk using cvi.ini and the command file.
00ProRef.book : 06chap08.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 8 Distributing Libraries and Function Panels National Instruments recommends that your installation program modify cvi.ini, .cvi.ini, or the Registry, automatically. Under Windows 3.1, the modini program is in the LabWindows/CVI bin subdirectory for this purpose. A documentation file called modini.doc and the source code are in the same directory.
00ProRef.book : 06chap09.fm Page 1 Monday, March 9, 1998 3:23 PM 9 Checking for Errors in LabWindows/CVI This chapter describes LabWindows/CVI error checking and how LabWindows/CVI reports errors in LabWindows/CVI libraries and compiled external modules. When you develop applications in LabWindows/CVI, you usually have debugging and the Break on Library Errors option enabled. With these features enabled, LabWindows/CVI identifies and reports programming errors in your source code.
00ProRef.book : 06chap09.fm Page 2 Monday, March 9, 1998 3:23 PM Chapter 9 Checking for Errors in LabWindows/CVI Note Status codes are integer values. These values are either common to an entire library of functions, or specific to one function. Libraries that have a common set of codes have a listing at the end of the chapter or manual they appear in. You can find the error message for each integer value there.
00ProRef.book : 06chap09.fm Page 3 Monday, March 9, 1998 3:23 PM Chapter 9 Checking for Errors in LabWindows/CVI After your program detects an error, it must take some action to either correct the situation or prompt the user to select a course of action. The following example shows a simple error response function. void ErrorCheck (char *errMsg, int errVal, char *errString) { char outputMsg[256]; int response; Fmt (outputMsg, "%s (Error = %d).
00ProRef.book : 06chap09.fm Page 4 Monday, March 9, 1998 3:23 PM Chapter 9 Checking for Errors in LabWindows/CVI Easy I/O for DAQ Library The Easy I/O for DAQ Library functions return a negative value when they detect an error. They return a positive value as a warning when they are able to complete their task but not in the way you might expect. This library uses a common set of error codes. The positive warning codes are the same absolute values as the negative error codes.
00ProRef.book : 06chap09.fm Page 5 Monday, March 9, 1998 3:23 PM Chapter 9 Checking for Errors in LabWindows/CVI iberr. After each GPIB call, your program should check whether the ERR bit is set to determine if an error has occurred, as shown in the following code segment. if (ibwrt(bd[instrID], buf, cnt) & ERR) PREFIX_err = 230; Refer to your NI-488.2 Function Reference and user manuals for detailed information on GPIB global variables and listings of status and error codes.
00ProRef.book : 06chap09.fm Page 6 Monday, March 9, 1998 3:23 PM Chapter 9 Checking for Errors in LabWindows/CVI TCP Library The TCP Library functions return a negative value when they detect an error. This library uses a common set of error codes, which the LabWindows/CVI Standard Libraries Reference Manual and the LabWindows/CVI function panel help list. You can use GetTCPErrorString to get the error message associated with each TCP Library error code.
00ProRef.book : 06chap09.fm Page 7 Monday, March 9, 1998 3:23 PM Chapter 9 Checking for Errors in LabWindows/CVI Formatting and I/O Library function that performed file I/O. The GetFmtIOErrorString function converts this code into an error string. Refer to the LabWindows/CVI Standard Library Reference Manual for more information. Utility Library Utility Library functions report error codes as return values.
00ProRef.book : 07AppA.fm Page 1 Monday, March 9, 1998 3:23 PM A Errors and Warnings This appendix contains an alphabetized list of compiler warnings, compiler errors, link errors, DLL loading errors, and external module loading errors generated by LabWindows/CVI. Table A-1. Error Messages Error Message Type Error Comment # flag is valid only with o, x, e, f, and g specifiers.
00ProRef.book : 07AppA.fm Page 2 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment ## at end of macro definition. Compile Error ## preprocessing token is at the end of a , or ) expected. Compile Error Ensure that the function macro argument list terminates with a ) and that a , separates all the macro arguments. 0 flag is not valid with c, s, p, and n modifiers.
00ProRef.book : 07AppA.fm Page 3 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Anonymous union declared inside parameter list has scope only for this declaration. Compile Warning Union declared in the parameter list has scope only within the parameter list. As a result, its type is incompatible with all other types. You must declare the union type before declaring function types that use it.
00ProRef.book : 07AppA.fm Page 4 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Assignment between TYPE and TYPE is compiler-dependent. Compile Warning Although allowed, use caution because an assignment of an integer type expression value to an enum type target might not correspond to any known enumeration constant for that enum type.
00ProRef.book : 07AppA.fm Page 5 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Assignment to const identifier NAME. Compile Error const variables or parameters are read-only values that you cannot modify once initialized. Ensure that no assignment operations modify the identifier. Assignment to const location.
00ProRef.book : 07AppA.fm Page 6 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Attempt to realloc uninitialized pointer. Fatal Run-time Error Pointer value you passed to the realloc function is invalid because you did not initialize it. It is probably an uninitialized local variable. You must initialize local variables before you use them. Attempt to write beyond end of array.
00ProRef.book : 07AppA.fm Page 7 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Bad OMF record at position NUMBER: OMF record type NAME. PC/Windows Load Error OMF object file contains an unknown object record. Make sure that the object file is OMF and conforms to the 32-bit format LabWindows/CVI supports. Bad relocation record encountered while reading external module: FILE.
00ProRef.book : 07AppA.fm Page 8 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Calling conventions have no effect on variables; calling convention ignored. The position of the calling convention modifier may be incorrect. Compile Warning You placed a calling convention keyword before a variable name. Cannot concatenate wide and regular string literals.
00ProRef.book : 07AppA.fm Page 9 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Cannot link variable NAME to import library without declspec(dllimport) keyword in declaration. Link Error Variable that you have declared as extern is defined in a DLL import library, but you did not include the declspec(dllimport) qualifier in the declaration. Case label must be a constant integer expression.
00ProRef.book : 07AppA.fm Page 10 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Compound statements nested too deeply. Compile Error Program has exceeded the compiler limitations on the number of nested compound statements; reduce the depth of the nested compound statements in the program. Conditional inclusion nested too deeply.
00ProRef.book : 07AppA.fm Page 11 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Could not find the DLL header file HEADER FILE. Glue Code Generation Error LabWindows/CVI could not find the file that contains the prototypes for the functions in the DLL. When generating glue code, ensure that you specify the correct filename. When loading a DLL, ensure that a header file with the same base name as the DLL exists.
00ProRef.book : 07AppA.fm Page 12 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Dereference of function pointer used as data. Fatal Run-time Error You converted a function pointer to a non-function pointer and then dereferenced it. You can only execute functions and access them as data. Dereference of invalid pointer expression. Fatal Run-time Error Pointer expression you dereferenced is invalid.
00ProRef.book : 07AppA.fm Page 13 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Dereference of uninitialized pointer. Fatal Run-time Error Pointer expression you dereferenced is invalid because you did not initialize it. It is probably an uninitialized local variable. You must initialize local variables before you use them. Duplicate case label NAME.
00ProRef.book : 07AppA.fm Page 14 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Error at or near character NUMBER in the format string: STRING. Non-Fatal Run-time Error Error exists in the format string at index NUMBER. NUMBER is 1-based. Error in Elf Library encountered while reading external module: NAME. Object Load Error Object module is corrupted or is of a type that LabWindows/CVI cannot load.
00ProRef.book : 07AppA.fm Page 15 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Extraneous formal parameter specification. Compile Error This error occurs when the compiler is processing what it assumes to be an old-style function declaration and encounters what it assumes to be the function’s parameter names.
00ProRef.book : 07AppA.fm Page 16 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Field name missing. Compile Error Identifier is missing from a member (field) declaration in a struct or union type declaration. Make sure that an identifier follows the member type specifier. Format string integer is too big. Non-Fatal Run-time Error Integer used in the format string is too large. Found TYPE expected a function.
00ProRef.book : 07AppA.fm Page 17 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Ill-formed constant integer expression. Compile Error Constant integer expression that appears in a preprocessor directive is syntactically invalid. Check the expression for trailing tokens. Ill-formed hexadecimal escape sequence \xCHAR.
00ProRef.book : 07AppA.fm Page 18 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Illegal formal parameter types. Compile Error Parameter type of void appears in a function prototype declaration that has more than one argument. Remove the void parameter type or change the function prototype so that it contains only the single void parameter type. Illegal header name; #include expects "FILE" or .
00ProRef.book : 07AppA.fm Page 19 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Illegal return type; found TYPE expected TYPE. Compile Error Return statement expression type is not the same as the return type of the function in which it appears. Ensure that the type of the return expression is consistent (assignment compatible) with the function return type.
00ProRef.book : 07AppA.fm Page 20 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Illegal type const TYPE. Compile Error You used more than one qualifier, such as const or volatile, in a type specification; for example, const const int. Do not use the const and volatile qualifiers more than once each in the same type. Illegal type for symbol 'DllMain': TYPE.
00ProRef.book : 07AppA.fm Page 21 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Illegal variable declaration; only static and extern variable classes are valid in the interactive window. Compile Error Change the variable declaration to be either static or extern. Import Variables cannot be used in global variable initialization.
00ProRef.book : 07AppA.fm Page 22 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Insufficient system memory for Interactive Window Link Error There is not enough memory to run the code in the Interactive Execution window. Insufficient system memory for project. Link Error There is not enough memory to link the project. Insufficient user data memory for project.
00ProRef.book : 07AppA.fm Page 23 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Invalid size for a real. Non-Fatal Run-time Error 4 and 8 are the only valid sizes that you can specify with the b modifier for the f (real) specifier. Invalid size for an integer. Non-Fatal Run-time Error 1, 2, and 4 are the only valid sizes that you can specify with the b modifier for the i, d, x, o, and c modifiers.
00ProRef.book : 07AppA.fm Page 24 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Invalid union field declarations. Compile Error Compiler encountered an invalid token while processing a struct or union type declaration.
00ProRef.book : 07AppA.fm Page 25 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Library function error (STRING == NUMBER). Non-Fatal Run-time Error Library function could not perform its task. The integer NUMBER is either the function return value or the value of a global variable that explains why the function failed. Refer to the library function reference material for more information about the error.
00ProRef.book : 07AppA.fm Page 26 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Missing argument to variable argument function. Fatal Run-time Error Variable argument function requires at least one argument beyond the last formal parameter. Missing array size.
00ProRef.book : 07AppA.fm Page 27 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Missing prototype. Compile Error Function declaration or call is for a function without prototype declaration information. The compiler issues the diagnostic if the Require Function Prototypes compiler option is enabled. Missing return value.
00ProRef.book : 07AppA.fm Page 28 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment No data relocation section found for external module: FILE. Link Error External object module does not contain the relocation information necessary to link it in with the rest of the project. You cannot load an executable as an object module. No data section found for external module: FILE.
00ProRef.book : 07AppA.fm Page 29 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Null Pointer. Fatal Run-time Error Pointer expression you passed to the library function has the value NULL, which is not a valid value for the function. Null pointer argument to library function.
00ProRef.book : 07AppA.fm Page 30 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Operands of ‘=‘ have incompatible calling conventions. Compile Error Function pointer is assigned an expression that does not match its calling convention. Operands of [one from set of binary operators] have illegal types TYPE and TYPE.
00ProRef.book : 07AppA.fm Page 31 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Overflow in constant CONSTANT. Compile Warning Value of a constant or constant expression exceeds the limits of the type. Ensure that the value does not exceed the maximum value for the expression type. Overflow in constant expression. Compile Warning Value of a constant or constant expression exceeds the limits of the type.
00ProRef.book : 07AppA.fm Page 32 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Pack pragma valid values are 1, 2, 4, 8, and 16. Compile Error pack pragma alignment value parameter must be 1, 2, 4, 8, or 16. Parameter type incompatible with format specifier. Non-Fatal Run-time Error Parameter type is not compatible with the type that the format string expects. An argument is either missing or of the wrong type.
00ProRef.book : 07AppA.fm Page 33 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Pointer is invalid. Non-Fatal Run-time Error Pointer argument to the function contains an invalid address. Pointer points to freed memory. Non-Fatal Run-time Error Pointer argument to the function points to memory that you already freed. Pointer subtraction involving address of nonarray object.
00ProRef.book : 07AppA.fm Page 34 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Project not linked. Link Warning This error occurs when the compiler reports one or more link errors in the Interactive Execution window and the project is not in a linked state. This warning provides a possible explanation for the link errors.
00ProRef.book : 07AppA.fm Page 35 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Redefinition of label NAME previously defined at POSITION. Compile Error You already used the statement label in this function. A statement label must be unique within the function in which you use it. Redefinition of macro NAME.
00ProRef.book : 07AppA.fm Page 36 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Segment must be of class CODE, DATA, BSS, or STACK: segment name NAME. Load Error External object module contains an unknown segment class. Object modules must not contain any specially-named segments. Segment must be USE32: segment name NAME. Link Error External object module you loaded contains unsupported 16-bit segments.
00ProRef.book : 07AppA.fm Page 37 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Stack Overflow. Fatal Run-time Error Program exceeds the stack limit. Change the size of the stack in the Run Options dialog box, if you think that the code is executing correctly. Otherwise, ensure that the program does not contain any infinite recursion.
00ProRef.book : 07AppA.fm Page 38 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Subtraction of pointers to freed memory. Non-Fatal Run-time Error One of the pointer expressions in the subtraction is invalid because it refers to a location in dynamic memory that you deallocated with the function free. Once memory is free, all pointers into that block of memory are invalid. Switch statement with no cases.
00ProRef.book : 07AppA.fm Page 39 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Syntax error; found TOKEN1 expecting TOKEN2. Compile Error Syntax error occurred because the compiler found TOKEN1 instead of TOKEN2. The __cdecl calling convention is not supported with functions returning floats, doubles, or structures in WATCOM Compatibility Mode.
00ProRef.book : 07AppA.fm Page 40 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Too many parameters. Non-Fatal Run-time Error Number of parameters you passed to a function exceed the number of parameters the format string expects. Type error in argument %d to %s, calling convention mismatch. Compile Error Function or function pointer you passed to a function does not have the correct calling convention.
00ProRef.book : 07AppA.fm Page 41 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Undefined label NAME. Compile Error You used the label NAME as the target of a goto statement in the function but it never appears as a statement label. Ensure the label appears in the same function as the goto statements of which it is a target. Non-local goto statements are illegal. Undefined size for TYPE NAME.
00ProRef.book : 07AppA.fm Page 42 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Undefined symbol NAME. Link Error You used a variable or function in the project but did not define it anywhere. Unexpected #elif; #endif expected. Compile Error Compiler encountered an #else preprocessor directive immediately prior to this #elif at the same level of conditional inclusion.
00ProRef.book : 07AppA.fm Page 43 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Unexpected end of format string. Non-Fatal Run-time Error Format string you passed to the function is not complete. It is missing a source or destination format specifier, or contains an incomplete format specifier. Unexpected token. Compile Error Compiler encountered an unexpected token while processing a #define preprocessor directive.
00ProRef.book : 07AppA.fm Page 44 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Unknown modifier. Non-Fatal Run-time Error One of the modifiers in a format specifier is not valid. Unknown or unsupported OMF record at position NUMBER: OMF record type NUMBER. Load Error LabWindows/CVI encountered an unknown OMF record while loading an external object module.
00ProRef.book : 07AppA.fm Page 45 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Unsigned operand of unary –. Compile Warning You performed a nonsensical unary negation operation on an unsigned type. A negation operation on an unsigned type is not effective. Unsupported segment combination type NUMBER: segment name NAME. Load Error LabWindows/CVI encountered a bad segment while loading an external object module.
00ProRef.book : 07AppA.fm Page 46 Monday, March 9, 1998 3:23 PM Appendix A Errors and Warnings Table A-1. Error Messages (Continued) Error Message Type Error Comment Variables defined as DLL imports cannot be defined with an initial value. Compile Error You assigned an initial value to a variable defined as a DLL import, for example: VXI address must be a multiple of 2 for word transfer. Fatal Run-time Error You attempted to perform VXI word transfer beginning at an odd address.
00ProRef.book : 09CCApx.fm Page 1 Monday, March 9, 1998 3:23 PM Customer Communication B For your convenience, this appendix contains forms to help you gather the information necessary to help us solve your technical problems and a form you can use to comment on the product documentation. When you contact us, we need the information on the Technical Support Form and the configuration form, if your manual contains one, about your system configuration to answer your questions as quickly as possible.
00ProRef.book : 09CCApx.fm Page 2 Monday, March 9, 1998 3:23 PM Fax-on-Demand Support Fax-on-Demand is a 24-hour information retrieval system containing a library of documents on a wide range of technical information. You can access Fax-on-Demand from a touch-tone telephone at 512 418 1111. E-Mail Support (Currently USA Only) You can submit technical support questions to the applications engineering team through e-mail at the Internet address listed below.
00ProRef.book : 09CCApx.fm Page 3 Monday, March 9, 1998 3:23 PM Technical Support Form Photocopy this form and update it each time you make changes to your software or hardware, and use the completed copy of this form as a reference for your current configuration. Completing this form accurately before contacting National Instruments for technical support helps our applications engineers answer your questions more efficiently.
00ProRef.book : 09CCApx.fm Page 5 Monday, March 9, 1998 3:23 PM LabWindows/CVI Hardware and Software Configuration Form Record the settings and revisions of your hardware and software on the line to the right of each item. Complete a new copy of this form each time you revise your software or hardware configuration, and use this form as a reference for your current configuration.
00ProRef.book : 09CCApx.fm Page 7 Monday, March 9, 1998 3:23 PM Documentation Comment Form National Instruments encourages you to comment on the documentation supplied with our products. This information helps us provide quality products to meet your needs. Title: LabWindows/CVI Programmer Reference Manual Edition Date: February 1998 Part Number: 320685D-01 Please comment on the completeness, clarity, and organization of the manual.
00ProRef.book : 10gloss.fm Page 1 Monday, March 9, 1998 3:23 PM Glossary Prefix Meaning Value m- milli- 10 –3 µ- micro- 10 –6 n- nano- 10 –9 A active window The window user input affects at a given moment. The title of an active window is highlighted. API Application Programming Interface. A set of functions exported by a library. Array Display A mechanism for viewing and editing numeric arrays.
00ProRef.book : 10gloss.fm Page 2 Monday, March 9, 1998 3:23 PM Glossary C cdecl A function calling convention in which function calls pass arguments from right to left, and the caller restores the stack position after the call. check box A dialog box item that allows you to toggle between two possible options. clipboard A temporary storage area LabWindows/CVI uses to hold text that is cut, copied, or deleted from a work area.
00ProRef.book : 10gloss.fm Page 3 Monday, March 9, 1998 3:23 PM Glossary F .fp file A file that contains information about the function tree and function panels of an instrument module. function panel A screen-oriented user interface to the LabWindows/CVI libraries in which you can interactively execute library functions and generate code for inclusion in a program. Function Panel Editor window The window in which you build a function panel. The LabWindows/CVI Instrument Driver Developers Guide.
00ProRef.book : 10gloss.fm Page 4 Monday, March 9, 1998 3:23 PM Glossary highlight The way in which input focus is displayed on a LabWindows/CVI screen; to move the input focus onto an item. I immediate action command A menu bar item that has no menu items associated with it and causes a command to execute immediately when you select it. An immediate action command is suffixed with an exclamation point (!). input control A function panel control that accepts a value you type in from the keyboard.
00ProRef.book : 10gloss.fm Page 5 Monday, March 9, 1998 3:23 PM Glossary L list box A dialog box item that displays a list of possible choices. lvalue A C expression that refers to an object that can be examined and modified. The name lvalue comes from the fact that only lvalues may appear on the left side of an assignment. Examples of lvalues are variables, parameters, array element references such as a[i], struct element references such as s->name or s.name, and pointer dereferences such as *ptr.
00ProRef.book : 10gloss.fm Page 6 Monday, March 9, 1998 3:23 PM Glossary R return value control A function panel control that displays a value returned from a function as a return value rather than as a formal parameter. ring control A function panel control that represents a range of values much like the slide control, but displays only a single item in a list, rather than displaying the whole list at once as the slide control does. Each item has a different value associated with it.
00ProRef.book : 10gloss.fm Page 7 Monday, March 9, 1998 3:23 PM Glossary Standard Input/Output window A LabWindows/CVI work area in which textual output to and input from the user take place. standard libraries The LabWindows/CVI User Interface, Analysis, Data Formatting and I/O, GPIB, GPIB-488.2, DDE, TCP, RS-232, Utility, and C system libraries.
00ProRef.book : 10gloss.fm Page 8 Monday, March 9, 1998 3:23 PM Glossary W Watch window A window that shows the values of selected variables and expressions that are currently active. window A working area that supports specific tasks related to developing and executing programs.
00ProRef.book : 11Index.
00ProRef.book : 11Index.
00ProRef.book : 11Index.fm Page 3 Monday, March 9, 1998 3:23 PM Index Create Dynamic Link Library command, 3-24, 7-18 Create Object File command, Options menu, 3-26 Create Standalone Executable File command, 3-20, 7-16 Create Static Library command, 3-21, 3-26 creating loadable compiled modules. See loadable compiled modules. platform-independent applications. See multiplatform applications, building. standalone executables. See standalone executables, creating and distributing. Windows DLLs.
00ProRef.book : 11Index.fm Page 4 Monday, March 9, 1998 3:23 PM Index status codes checking function call status codes, 9-1 returned by LabWindows/CVI functions, 9-2 to 9-3 status reporting by libraries and instrument drivers, 9-3 to 9-7 errors. See also user protection errors. compiler-related error messages, A-1 to A-46 events, multiplatform application considerations, 6-3 executable file, required for standalone executables, 7-8 executables, creating and distributing.
00ProRef.book : 11Index.fm Page 5 Monday, March 9, 1998 3:23 PM Index F G fax and telephone support numbers, B-2 Fax-on-Demand support, B-1 files for running standalone executables accessing UIR, image, and panel state files, 7-12 DLL files Windows 3.1, 7-13 to 7-14 Windows 95/NT, 7-13 loading files using LoadExternalModule, 7-14 to 7-18 DLL files and DLL path files (Windows 3.
00ProRef.book : 11Index.
00ProRef.book : 11Index.fm Page 7 Monday, March 9, 1998 3:23 PM Index 32-bit Borland or Symantec compiled modules under Windows, 4-2 to 4-3 32-bit Watcom compiled modules under Windows 3.
00ProRef.book : 11Index.
00ProRef.book : 11Index.
00ProRef.book : 11Index.fm Page 10 Monday, March 9, 1998 3:23 PM Index system requirements Windows 3.
00ProRef.book : 11Index.fm Page 11 Monday, March 9, 1998 3:23 PM Index math coprocessor software emulation for Windows 3.
00ProRef.book : 11Index.
00ProRef.book : 11Index.fm Page 13 Monday, March 9, 1998 3:23 PM Index User Interface Library, 9-3 user interface resource (.uir) files accessing from running standalone executables, 7-12 multiplatform application considerations, 6-3 required for running standalone executables, 7-9 resolving callback references from, 3-10 to 3-12 linking to callback functions not exported from DLL, 3-11 to 3-12 user libraries. See also libraries.
00ProRef.book : 11Index.fm Page 14 Monday, March 9, 1998 3:23 PM Index Windows 16-bit DLLs creating with Borland C++, 4-22 with Microsoft Visual C++ 1.
00ProRef.book : 11Index.fm Page 15 Monday, March 9, 1998 3:23 PM Index releasing resources when DLL unloads, 3-3 to 3-4 run state change callbacks in DLLs, 3-2 to 3-3 using LoadExternalModule function, 3-2 for standalone executables distributing, 7-9 loading with LoadExternalModule, 7-17 location, 7-10 rules for using, 7-13 using run state change callbacks, 2-6 to 2-7 Windows 95/NT 32-bit DLLS. See Windows 32-bit DLLs.
00ProRef.book : 11Index.fm Page 16 Monday, March 9, 1998 3:23 PM Index LabWindows/CVI libraries in external compilers, 3-9 to 3-15 calling InitCVIRTE and CloseCVIRTE, 3-14 to 3-15 include files, 3-10 resolving callback references from .
00ProRef.book : 11Index.