Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Meine erste DLL / Freigeben / Unload ? (https://www.delphipraxis.net/46630-meine-erste-dll-freigeben-unload.html)

turboPASCAL 28. Mai 2005 17:18


Meine erste DLL / Freigeben / Unload ?
 
Hi, hab da mal ne' Frage... :-D

Bin gerade dabei meine erste DLL zu basteln.
In der DLL ist eine Form, die ich aus der App aufrufe (Form ist Showmodal).
Läuft alles so, aaaaber muss man in der App die DLL wieder irgend wie freigeben,
oder ist das falsch wie ich das mache ?


In der App:
Delphi-Quellcode:
...
  Function ViewInfoDll : Integer; stdcall; external 'Info.Dll';
...
implementation
...

procedure TForm1.Button1Click(Sender: TObject);
begin
  try
    ViewInfoDll; // Aufruf der Form aus Dll
  except
    on E: Exception do
    begin
      Application.MessageBox(pchar('Fehler beim Aufruf der DLL: ' +
        E.Message ),'Upps !', MB_ICONERROR + MB_OK);
    end;
  end;
end;
Die DLL:
Delphi-Quellcode:
...
function ViewInfoDll : Integer; stdcall;
...
Function ViewInfoDll : Integer;
Begin
  DLLInfoForm := TDLLInfoForm.Create(Application);
  DLLInfoForm.ShowModal;
  DLLInfoForm.Free;
  Result := 0;
End;
...
Danke im voraus!

Boombuler 30. Mai 2005 07:25

Re: Meine erste DLL / Freigeben / Unload ?
 
Da du statische Einbindung gewählt hast passiert das automatisch... kannst du ja auch so gar net wenn du kein Instanzhandle der DLL hast :)

diese Frage stellt sich erst beim dynamischen Einbinden von DLLs...

Greetz
Boombuler


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:28 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz