Page 2 of 2

Re: FreeLibrary, madExcept and win8

Posted: Thu Jan 09, 2020 2:59 pm
by fpiette
Here attached if a very simple DLL and calling application.
When madExcept is enabled, FreeLibrary freeze the application.
Whitout madExcept, everything is OK.

Re: FreeLibrary, madExcept and win8

Posted: Thu Jan 09, 2020 5:32 pm
by madshi
Thanks! How urgent is this? I'm currently busy with another project. Was planning to work on a new madExcept builds later this month or early February. Can it wait that long, or is it urgent?

Re: FreeLibrary, madExcept and win8

Posted: Thu Jan 09, 2020 7:34 pm
by fpiette
It is not very urgent. Later this month is OK.
Thanks

Re: FreeLibrary, madExcept and win8

Posted: Fri Feb 21, 2020 3:47 pm
by fpiette
Any news about this issue?
Thanks.

Re: FreeLibrary, madExcept and win8

Posted: Mon Mar 23, 2020 10:45 am
by madshi
Hi there, and my apologies for taking so long. So here's a new build:

http://madshi.net/madCollectionUpdate.exe

You need to do 2 changes in your test project:

1) In the DLL dpr add the following line: "exports FinalizeMadExcept;".

2) In the EXE form pas change the code as follows:

Code: Select all

procedure TFreeLibraryFreeze.FreeLibraryButtonClick(Sender: TObject);
var Dll_FinalizeMadExcept : procedure;
begin
    if LibHandle = 0 then begin
        ShowMessage('Library not loaded');
        Exit;
    end;

    Dll_FinalizeMadExcept := GetProcAddress(LibHandle, 'FinalizeMadExcept');
    if @Dll_FinalizeMadExcept <> nil then
      Dll_FinalizeMadExcept;
    FreeLibrary(LibHandle);
    ShowMessage('Success!');
    LibHandle := 0;
end;
Together with the new madExcept build this should fix the problem. At least it does here, testing 32bit compiling with XE8.

Re: FreeLibrary, madExcept and win8

Posted: Mon Mar 23, 2020 11:35 am
by fpiette
Thanks you so much.
I will try this fix and comes back here if I still have issue. No reply from me means everyting is OK.
btw: I'm using Delphi 10.3.4.

François Piette
Embarcadero MVP