http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/bas
e/loadlibrary.asp
The search order is as follows
1. The directory from which the application loaded.
2. The system directory. Use the GetSystemDirectory function to get the
path of this directory.
3. The 16-bit system directory. There is no function that obtains the
path of this directory, but it is searched.
Windows Me/98/95: This directory does not exist.
4. The Windows directory. Use the GetWindowsDirectory function to get the
path of this directory.
5. The current directory.
6. The directories that are listed in the PATH environment variable.
As you can see, load location of a random dll in a chain of dlls is not
used, only application directory, path and Windows directories apply. Hence
if you want a.dll to find b.dll without placing them on a path or in
system32, you'll have to manually load them (i.e. Construct loading path
according to your custom rules and call LoadLibrary with the full path.
Alternatively, if you use COM objects, you can make object in b.dll to be a
COM object, register it in registry and have a.dll to instantiate it using
CoCreateInstance. In this case dll search rules do not apply since correct
path is listed in the registry.
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights
On 12/29/04 7:05, in article
pan.2004.12.29.15.05.22.808000@SPAM-AWAYpoczta.onet.pl, "Piotr Szukalski"
<amigos_@SPAM-AWAYpoczta.onet.pl> wrote:
> Hi!
>
[quoted text clipped - 15 lines]
> Thanks in advance,
> Piotrek