Jump to content

Remove DLL (FreeImage)


Recommended Posts

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

Oops, small bug in _FreeImage_UnLoadDLL() :unsure: 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 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

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 :unsure:

I am just a hobby programmer, and nothing great to publish right now.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...