Reputation: 40175
This is something new for me, and the question is probably more about the Delphi IDE than the code.
I want to develop a DLL and two applications which will use it.
I made a very basic DLL and a quick dummy app to test it. So far, so good. BUT, all the source was in a single directory.
I feel that I probably ought to have a group project containing three projects (DLL + 2 apps).
But how do I get the apps to use my DLL during the development phase?
I don't want to copy it into the windows system directory while I am in the process of develop it, but when I add it's directory to the app's search path it is not found.
How do I configure my app projects to use the still in development DLL?
[Update] Wow, my quickest ever down-vote. One minute! And, as usual, not even a comment to say how I offended, other than asking for help.
I have googled, and I have read the help. But I can't see how to do it, so am asking for help.
Upvotes: 2
Views: 210
Reputation: 613262
The preferred way to enable an application to see a DLL is for the DLL to be located in the same directory as the host executable.
I typically do that by having a project group with executable and DLL. Make sure that all the projects output their executables to the same directory. If the .dpr and .dproj files are all in the same directory, and the default output directory of .\$(Platform)\$(Config)
is used, then all will be well. All executable files land in the same directory, and the loader will find them.
Doing it this way has a number of benefits:
An aside. You said:
I don't want to copy it into the Windows system directory while I am in the process of develop it.
Well, please don't ever copy it into the system directory. That directory is private, it is owned by the system. You should not place files there.
When you come to deploy your application onto other machines, you should prefer the option of placing executable and DLLs in the same directory. That's the simplest deployment technique, and the most secure and maintainable. That's the method that avoids DLL hell.
Upvotes: 5