Where to put the resource .dll

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Where to put the resource .dll

Peter Kenny-2
Hi all

I have solved a problem by trial and error, but I wonder whether the
solution should have been obvious to me. Could someone please advise me?

My app needs to access the Dolphin resource file DolphinDR005.dll. When it
is run in the development system, it manages OK, presumably finding the copy
of the .dll in c:\Program Files\Object Arts\Dolphin Smalltalk 5.1. When it
is run from the .exe produced by Lagoon, it will not access it unless there
is a copy of the .dll in the same directory as the .exe. Is this universally
true? i.e. when I distribute the app, will users (who generally will not
have Dolphin installed) have to put the .dll in the same directory as the
.exe? Or does the .exe have any more general search strategy for finding the
.dll?

Thanks for any guidance
--
Best wishes

Peter Kenny


Reply | Threaded
Open this post in threaded view
|

Re: Where to put the resource .dll

Chris Uppal-3
Peter Kenny wrote:

> My app needs to access the Dolphin resource file DolphinDR005.dll. When it
> is run in the development system, it manages OK, presumably finding the
> copy of the .dll in c:\Program Files\Object Arts\Dolphin Smalltalk 5.1.
> When it is run from the .exe produced by Lagoon, it will not access it
> unless there is a copy of the .dll in the same directory as the .exe. Is
> this universally true? i.e. when I distribute the app, will users (who
> generally will not have Dolphin installed) have to put the .dll in the
> same directory as the .exe? Or does the .exe have any more general search
> strategy for finding the .dll?

As far as I know, Windows uses the current %Path% to find and load DLLs which
are not fully specified.  It always (implicitly) includes the directory where
the .exe was found at the head of that path (and also includes the
application's current directory, I think, but I'm not certain of that, nor of
which of the two comes first in the list).

I don't know how Windows locates DLLs needed by other DLLs, my guess
(unsubstantiated) is that it looks in the same directory as the DLL which is
loading the new DLL.

Anyway putting "extra" DLLs in the same directory as your deployed .exe is the
right thing to do.  (Albeit it is not the /only/ right way to do it.)

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Where to put the resource .dll

Peter Kenny-2
"Chris Uppal" <[hidden email]> wrote ...

> As far as I know, Windows uses the current %Path% to find and load DLLs
> which
> are not fully specified.
>
[snip]
>
> Anyway putting "extra" DLLs in the same directory as your deployed .exe is
> the
> right thing to do.  (Albeit it is not the /only/ right way to do it.)
>

Chris

Many thanks. I have never fully mastered the Path idea (like many other
aspects of Windows!), but at least I know how to deal with the problem now.

Peter