Quick Reports in DLL

I want to put a quick report form in a DLL.
It works fine but for one problem.
When I close the form the application calling the DLL freezes.
I create/destroy the QR form dynamically etc. The Standard delphi form is OK, as are database connnections, its just this QR form !!!
liferilyAsked:
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.

LischkeCommented:
Mmmh, how do you create the form? Do you set Application as owner? Have you passed in the application handle from the main application to the DLL?

Ciao, Mike
0
liferilyAuthor Commented:
I have not passed the application handle explicitly. I will look at that next..

I have created a standard delphi form
(application owned)

from that I create a QR form
(application owned)

I destroy the QR form after previewing it, then destroy the standard form after showing it

I get to FreeLibrary(Handle); at which point it freezes - trying to free the library.
0
LischkeCommented:
AFAIK, the problem is that the DLL as well as the main application create their own TApplication object. If you now create the form in the DLL with the TApplication object from there and try to free it from your main application then the wrong TApplication object is used.

Not sure if that's the true problem, but try either to allocate and free all forms belonging to the DLL only in the DLL or make both TApplication objects the same (preferably the main appl. stays...).

Ciao, Mike
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

liferilyAuthor Commented:
I have just passed the application handle in a quick test app

It appears to work !!!!!

I will go back to a more involved program and check it out in more depth.

If all goes OK the points are yours if you want them - Do you need to post an answer ????

Cheers Lischke,

liferily.
0
liferilyAuthor Commented:
I think you've hit the handle on the head (sort of pun!).

The forms were all created and destoyed within the DLL, however I don't think I was using the correct application handle within the DLL.

Like I've just said I'll have a more in-depth investigation...
0
LischkeCommented:
Fine :-) I just propose an answer here to make sure no other does. The "accept as answer" feature works also very well...

Ciao, Mike
0

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
Delphi

From novice to tech pro — start learning today.