Solved

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

Posted on 2013-10-27
4
756 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
  • 3
4 Comments
 
LVL 25

Expert Comment

by:Sinisa Vuk
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Found solution by myself.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now