Solved

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

Posted on 2013-10-27
4
784 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Spellcheck in Webbrowser 1 73
Why use this lambda? 12 93
Java List 4 73
Java Inheritance super keyword use 8 68
This is an explanation of a simple data model to help parse a JSON feed
A short article about problems I had with the new location API and permissions in Marshmallow
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 …

739 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