Problems with share dlls

I have a master application, this application load several dlls. These dlls can call another dlls for share data and a database connection.
Each time that a dll is loaded a instance of this dll is loaded in memory and make a another connection a Database.

This application is for Windows NT and 9x

I use Informix Dinamyc Server as Database server and i use TQuery components for access data.

I programming in Delphi 4 c/s.

How can I share a single database connection and variables for several dlls?

Note: Somebody tell me about createmapfile but I think is not a good idea because i need share a objects and executable code
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You will need to use packages to do this (in fact, using packages almost does the whole job for you...)

To turn package support on go to Project|Options -> Packages and enable "Build with runtime packages".

Do this for your .EXE and all your DLLs.

Now add a method to each DLL which passes in the necessary variables to that DLL which can then use them like any other variable.

And that should be that!



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.