Initiates a DLL file.

Syntax

LOAD DLL [<path>] <DLL filename>

[<path>] <DLL name>

The name of the DLL file. <path> is the directory path to the DLL file in which the external function is stored.

Description

Use LOAD DLL to make the resources of a DLL file available to your application.

Note

dBASE Plus uses 32-bit DLLs only; it cannot use 16-bit DLLs.

You can also use LOAD DLL to check for the existence of a DLL file. For example, you can use the ON ERROR command to execute an error trapping routine each time the LOAD DLL command can't find a specified DLL file.

LOAD DLL does not use the dBASE Plus path to find DLL files. Instead, it searches the following directories:

  1. The directory containing PLUS.exe, or the directory in which the .EXE file of your compiled application is located.

  2. The current directory.

  3. The 32-bit Windows system directory (for example, C:\WIN98\SYSTEM).

  4. The 16-bit Windows system directory, if present (for example, C:\WINDOWS\SYSTEM).

  5. The Windows directory (for example, C:\WINNT)

  6. The directories in the PATH environment variable

A DLL file is a precompiled library of external routines written in non-dBL languages such as C and Pascal. A DLL file can have any extension, although most have extensions of .DLL.

When you initialize a DLL file with LOAD DLL, dBASE Plus can access its resources; however, it doesn't become resident in memory until your program or another Windows program uses its resources.

To access a DLL function, create a dBL function prototype with EXTERN. Then, using the name you specified with EXTERN, call the routine as you would any dBL function.