The Mudcat Café TM
Thread #50250   Message #761796
Posted By: GUEST
08-Aug-02 - 07:32 AM
Thread Name: TECH: And now it's the dll files...
Subject: RE: TECH: And now it's the dll files...
It does not "depend". There is no single right location for a dll as Windows uses a search to find them. This is how it works according to the Win32 SDK help file. Windows searches:

1. The directory that contains the module for the current process.

2. The current directory.

3. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.

4. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.

5. The directories listed in the PATH environment variable.

In the case of load time (statically linked) dlls:

If the system cannot locate a specified DLL, it terminates the process and displays a dialog box that reports the error. Otherwise, the system maps the DLL modules into the virtual address space of the process and increments the DLL reference count.

In the case of run time (dynamic) dlls.

Run-time dynamic linking enables the process to continue running even if a DLL is not available. The process can then use an alternate method to accomplish its objective. For example, if a process is unable to locate one DLL, it can try to use another, or it can notify the user of an error. If the user can provide the full path of the missing DLL, the process can use this information to load the DLL even though it is not in the normal search path. This situation contrasts with load-time linking, in which the operating system simply terminates the process if it cannot find the DLL.