Einzelnen Beitrag anzeigen

Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#1

Meine erste DLL / Freigeben / Unload ?

  Alt 28. Mai 2005, 17:18
Hi, hab da mal ne' Frage...

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!
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser
  Mit Zitat antworten Zitat