Chapter 7 Creating and Distributing Standalone Executables and DLLs
©
National Instruments Corporation 7-13 LabWindows/CVI Programmer Reference Manual
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
importlibrary. 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 followingways:
List it in your project.
Asso c iate it with the .fp file for an instrument driver or user library.
Dynamically load it by a calling LoadExternalModule.
If you list a DLL import library in the project or associate it with an instrument driver or user
library, LabWindows/CVI statically links the import library into your executable or DLL. On
the other hand, if you load the import library through a call to LoadExternalModule, you
must distribute it separately from your executable. Refer to the Rules for Loading Files Using
LoadExternalModule section later in this chapter for more information.
Regardless of the method you use to link the import library, you must distribute the subsidiary
DLL separately. The import library always contains the name of the subsidiary DLL. When
your executable or DLL is loaded, the operating system finds the subsidiary DLL using the
standard DLL search algorithm, which the Windows SDK documentation for the
LoadLibrary function describes. The search precedence is as follows:
1. The directory from which the user loads the application
2. The current working directory
3. Under Windows 95, the Windows system directory. Under Windows NT, the W i nd ows
system32 and system directories
4. The Windows directory
5. The directories listed in the PATH environment variable
The Create Distribution Kit command automatically includes in your distribution kit the
DLLs that the import libraries in your project refer to. You must add to the distribution kit
any DLLs that you load through LoadExternalModule or that you load by calling the
Windows SDK LoadLibrary function.
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.
Rules for Using DLL Files under Windows 3.1
LabWindows/CVI never links DLL files and DLL path files into the executable, so you must
distribute them as separate files. The Create Distribution Kit command automatically
includes DLLs that your project refers to in your distribution kit. The only exceptions are
DLLs for National Instruments hardware and DLLs that you load using
LoadExternalModule.

00ProRef.book : 06chap07.fm Page 13 Monday, March 9, 1998 3:23 PM