How Windows Locates DLLs

Windows locates a DLL by searching the same directories it searches to find an application module. To be found by Windows, the DLL must be in one of the following directories:

1.The current directory

2.The Windows directory (the directory containing WIN.COM); the GetWindowsDirectory function obtains the pathname of this directory

3.The Windows system directory (the directory containing such system files as KERNEL.EXE); the GetSystemDirectory function obtains the pathname of this directory

4.Any of the directories listed in the PATH environment variable

5.Any directory in the list of directories mapped in a network

Windows searches the directories in the listed order.

Implicitly loaded libraries must be named with the .DLL extension.

This section explained what a DLL does in the context of the Windows environment. The next section explains what a custom DLL can do for your application.