DanEgli
asked on
Fixed Location of DLL
In a lot of programs I have seen where the program keeps all the DLL's in a certain directory and all other programs refference those DLL's from that directory (Not current dir, Not System or System32 dir! i.e. C:\PROGRAM FILES\VENDOR\PROGRAM\MODUL E1\MODULE. EXE reads LIBRARY1.DLL from C:\PROGRAM FILES\VENDOR\LIBRARIES\LIB RARY1.DLL)
How do you do this? At work we have our product that uses a couple of DLL's and currently the only way we have found to be sure that all programs have access to the DLL is to put a copy in each directory (I know it's a bad idea! But since my sup refuses to let us tell the clients to install the program on each workstation, instead just install it once and map a shared folder for everyone who uses the program) it's the best option we've found.
If someone has an idea, I'm all ears. BTW, it cannot be absolute path requirements unless you can also provide a way to obtain the absolute directory the program is run from.
Thanks!
-- Dan
How do you do this? At work we have our product that uses a couple of DLL's and currently the only way we have found to be sure that all programs have access to the DLL is to put a copy in each directory (I know it's a bad idea! But since my sup refuses to let us tell the clients to install the program on each workstation, instead just install it once and map a shared folder for everyone who uses the program) it's the best option we've found.
If someone has an idea, I'm all ears. BTW, it cannot be absolute path requirements unless you can also provide a way to obtain the absolute directory the program is run from.
Thanks!
-- Dan
ASKER
Oh... So then first question is what is handle? (handle := ??), next, is that static or dynamic loading? I'd prefer static loading (i.e. program starts up, and if it's missing a dll it says so and quits). Third. Since you are using a kind of Handle do I need to call procedure/functions like Handle.Foo(a,b,c); or is it just Foo(a,b,c);??
Thanks!
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
should say..
needs the path in there already..
and..
var
dllpath: String;
needs the path in there already..
and..
var
dllpath: String;
ASKER
so for a static load that would place the dll in, say, ..\libs\mylib.dll, calling procedure Foo, it would be like this?
procedure Foo(a,b,c : string) ; External '..\libs\mylib.dll';
This correct?
Thanks!
procedure Foo(a,b,c : string) ; External '..\libs\mylib.dll';
This correct?
Thanks!
Another possibility is to add it to the shared DLL's of the system. It is then found automatically, without the need to link it "hard" in the EXE file.
The following registry key holds the pasths to DLL's:
HKEY_LOCAL_MACHINE\SOFTWAR E\Microsof t\Windows\ CurrentVer sion\Share dDLLs
The following registry key holds the pasths to DLL's:
HKEY_LOCAL_MACHINE\SOFTWAR
cheers dan
I think you will find the dll will get added automatically to the regkey: HKEY_LOCAL_MACHINE\SOFTWAR E\Microsof t\Windows\ CurrentVer sion\Share dDLLs
after it's been used once.
Regards,
Steve
I think you will find the dll will get added automatically to the regkey: HKEY_LOCAL_MACHINE\SOFTWAR
after it's been used once.
Regards,
Steve
Handle := LoadLibrary(Application.Ex
or add the dll path to the PATH env. variable.
Regards,
Steve