Solved

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

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

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

In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…

792 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