From: Fabio Sobral on
Hi.

I'm working on a dll to be used by a third party program, and my dll makes
use of general purpose functions from a second dll also created by me.
I thought the program would work fine if both dlls were on the same folder,
but it only works if my second dll is placed inside the Windows/System32
folder.
I'd like to know if there's a way to register the path to this second dll so
it can be correctly loaded.


Thanks,
Fabio.
From: Kerem G�mr�kc� on
Hi Fabio,

use depends or a debugger to get the loading
paths/accesses of all libraries in you application:

http://www.dependencywalker.com/

Do a profilling on your application. See depends
help on "profilling" for more info,...

It would be also very usefull to tell us "what"
exactly is not working and what error codes
do you get when it fails, whatever fails,...

Regards

Kerem

--
--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Fabio Sobral" <FabioSobral(a)discussions.microsoft.com> schrieb im
Newsbeitrag news:E144321B-5721-4C91-BD4D-3E9E7EE6D7B2(a)microsoft.com...
> Hi.
>
> I'm working on a dll to be used by a third party program, and my dll makes
> use of general purpose functions from a second dll also created by me.
> I thought the program would work fine if both dlls were on the same
folder,
> but it only works if my second dll is placed inside the Windows/System32
> folder.
> I'd like to know if there's a way to register the path to this second dll
so
> it can be correctly loaded.
>
>
> Thanks,
> Fabio.


From: Tim Roberts on
Fabio Sobral <FabioSobral(a)discussions.microsoft.com> wrote:
>
>I'm working on a dll to be used by a third party program, and my dll makes
>use of general purpose functions from a second dll also created by me.
>I thought the program would work fine if both dlls were on the same folder,
>but it only works if my second dll is placed inside the Windows/System32
>folder.
>I'd like to know if there's a way to register the path to this second dll so
>it can be correctly loaded.

The DLL search algorithm is well-defined:

http://msdn.microsoft.com/en-us/library/7d83bc18.aspx

If the app loads the first DLL by name only, then it should be able to find
the second in the same directory. But if the app loading the first DLL by
using a full path, then that path will not be in the search.
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.
From: roger.orr on
On Jul 1, 6:41 pm, Fabio Sobral
<FabioSob...(a)discussions.microsoft.com> wrote:
> Hi.
>
> I'm working on a dll to be used by a third party program, and my dll makes
> use of general purpose functions from a second dll also created by me.
> I thought the program would work fine if both dlls were on the same folder,
> but it only works if my second dll is placed inside the Windows/System32
> folder.
> I'd like to know if there's a way to register the path to this second dll so
> it can be correctly loaded.
>
> Thanks,
> Fabio.

If the 3rd party program loads your library explicitly, then it would
be worth investigating using LoadLibraryEx with the
LOAD_WITH_ALTERED_SEARCH_PATH flag.

Regards,
Roger.