Solved

Delphi app crashes after unloading dll for the second time on Win 64

Posted on 2013-10-27
4
779 Views
Last Modified: 2013-11-22
Hello,

I created a small app which loads two different dlls dynamically. Loading works fine, everythings is working. When I unload the dlls with freelibrary everything is still okay, but when I load any of the dlls again and unload one of them my app crashes. The strange thing is on Win 7 32-bit it works, on Win 7 64-bit it crashes.

Any help would be appreciated.

Many thanks in advance

Norbert
0
Comment
Question by:zabx2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 39604401
My guess is that some COM stuff is not released correctly or there is some memory leak. Try to just load and free dlls without calling any function from it. Is this ok?
0
 

Author Comment

by:zabx2
ID: 39639921
Sorry for the delay.
Unfortunately your suggestion didn't work. I even deleted almost any components from the form and get the same error. I did some more research and encountered more strange errors.
When I build the DLL in an 64-bit environment and with DXE3 as a 32-bit DLL (!) the DLL works on Win 7 64-bit but crashes in Win 7 32-bit, but it is an 32-bit DLL!
I have no more time left doing some more research so I will build the DLL from scratch in DXE and will see what will happen.
Thank you very much.
0
 

Accepted Solution

by:
zabx2 earned 0 total points
ID: 39654948
Got a solution now. I'm working with several updated Developer Express components in my DLLS, and it is absolutely essential to set dxInitialie and dxFinalize in the initialization and finalization section of the main form. No where else! Not in form.create and not in form.destroy. Then everything works fine.

Thank you very much.
0
 

Author Closing Comment

by:zabx2
ID: 39668425
Found solution by myself.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question