Myicq Posted May 3, 2011 Share Posted May 3, 2011 I have developed a small application using FreeImage DLL. I enclose the DLL inside the compiled EXE, so that the DLL is written to @ScriptDir if it is not there already. That part works just fine. My problem is at program exit. I would like to clean up nicely. I have tried the following Case $btnEXIT if FileExists(@ScriptDir & "\FreeImage.dll") Then _FreeImage_DeInitialise() _FreeImage_UnLoadDLL() ; UNLOAD THE DLL Sleep(1000) FileDelete(@ScriptDir & "\FreeImage.dll") EndIf Exit but the DLL is still there at program exit. I assume that the DLL is somehow locked by FreeImage or the program, alas a catch-22. Any hints ? I am just a hobby programmer, and nothing great to publish right now. Link to comment Share on other sites More sharing options...
trancexx Posted May 3, 2011 Share Posted May 3, 2011 You should know if you have it locked, it's your responsibility to know what your code does. Check one more time unloading and loading functions. You have a leak of handles. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
ProgAndy Posted May 3, 2011 Share Posted May 3, 2011 (edited) Oops, small bug in _FreeImage_UnLoadDLL() I used a wrong variable in DLLClose (refcount instead of handle) PS: I'm updating the UDF, also adding about 50 new functions of new FreeImage release. Edited May 3, 2011 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Myicq Posted May 3, 2011 Author Share Posted May 3, 2011 You should know if you have it locked, it's your responsibility to know what your code does. Ehh excuseme, that is exactly what I tried to keep track of. And actually turned out to be UDF with a small typo. So treat me gently I am just a hobby programmer, and nothing great to publish right now. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now