From: Nobody on 29 Nov 2009 08:50 "Ulrich Korndoerfer" <ulrich_wants_nospam(a)prosource.de> wrote in message news:%23np9Q2JcKHA.1648(a)TK2MSFTNGP05.phx.gbl... > The windows system, when told to load a (standard) dll, searches for this > dll in a variety of folders, starting with the folder the caller is in > (the dhRichCLient3.dll), then, if not found, searching other folders, > amongst them is the system folder. I am not sure it looks first in the caller DLL folder, but rather the EXE folder. See Remarks section of LoadLibrary() in MSDN Oct 2001, or this page online: Dynamic-Link Library Search Order: http://msdn.microsoft.com/en-us/library/ms682586(VS.85).aspx
From: Ulrich Korndoerfer on 29 Nov 2009 17:31
Hi, Nobody schrieb: > "Ulrich Korndoerfer" <ulrich_wants_nospam(a)prosource.de> wrote in message > news:%23np9Q2JcKHA.1648(a)TK2MSFTNGP05.phx.gbl... >> The windows system, when told to load a (standard) dll, searches for this >> dll in a variety of folders, starting with the folder the caller is in >> (the dhRichCLient3.dll), then, if not found, searching other folders, >> amongst them is the system folder. > > I am not sure it looks first in the caller DLL folder, but rather the EXE > folder. See Remarks section of LoadLibrary() in MSDN Oct 2001, or this page > online: > > Dynamic-Link Library Search Order: > http://msdn.microsoft.com/en-us/library/ms682586(VS.85).aspx Now this article does not explicitely state how the search order is for those dlls, that a dll (especially a registered COM server dll), that is loaded from an exe, loads. I have often done this and it always worked for COM server dlls, that in turn depend on standard dlls: - put the COM server dll and its dependend standard dlls in the same folder (may be any folder, including being not the applications folder) and register the COM server dll in this folder The dependend dlls always are found. I did not *test* wether the system looks *first* in the Com server dlls folder. But this (deducing this by applying some logic thinking) must be so, because non of the standard folders (system, windows, current) points to the dependend dlls, so the only folder remaining is the one MS refers to be the application folder, but in my oppinion should be noted as the COM servers folder. I trust the MS documentation in that the application folder is the first one to be searched, and, deducing, meaning the Com servers folder. -- Ulrich Korndoerfer VB tips, helpers, solutions -> http://www.proSource.de/Downloads/ |