Autor Beitrag
Larus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Sa 12.02.05 22:17 
Wie kann ich eine Form in eine DLL einbinden und zur laufzeit vom Programm aufrufen lassen?
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Sa 12.02.05 22:27 
Der einfachste Weg ist dir eine fertige DPR Datei zu nehmen und in die erste Programmzeile statt program library zu schreiben. Vor das begin im Quellcode sollte dann noch der Name des Exports und vor das abschließende end. noch ein end; um den Export zu schließend und ein exports xxx um das ganze auch aufrufen zu können.
Die DLL kannst du dann im anderen Programm ganz normal einbinden:
ausblenden Delphi-Quelltext
1:
procedure ForumularZeigen; external 'MeineDLL.dll';					


Gruß,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Sa 12.02.05 22:30 
Titel: Wie binde ich ein Formular ein
Tja nun bleibtz nur noch die Frage wie ich ein Formular in die DLL einbinden kann....
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Sa 12.02.05 22:38 
wie bereits beschrieben, du nimmst eine fertige dpr Datei, in welche die fertigen Units und Formularresourcen bereits eingehängt sind.

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: So 13.02.05 18:59 
Titel: ???
KAnnse das evtl. genauer erklären ich check das net so ganz wie du das meinst :?
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mo 14.02.05 15:28 
Du erstellst dir erstmal ein Projekt, so wie du es auch bei einer EXE Datei machen würdest, bearbeitest dein Formular nach deinen Wünschen - fügst neue Formulare ein, etc. Bis dahin nichts neues. Wenn soweit alles fertig ist, veränderst du die erste Zeile deiner Projektdatei (DPR) von program Test zu library Test. Weiter unten in der Datei folgt dann ein begin, wo du procedure ShowForm; vorschreibst. Vor die letzte Zeile (in der nur end. steht) schreibst du noch end; um die oben "erstellte" Procedure zu beenden und exports ShowForm; damit das Forumular auch über die DLL abrufbar ist.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
library Test;      // <= Das wird geändert

uses
  Forms,
  Main in 'Main.pas';

procedure ShowForm; // <= Das kommt dazu
begin
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end;              // <= Das kommt dazu

exports ShowForm; // <= Das kommt dazu

end.

So jetzt müsste er wirklich verständlich sein :roll:

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 14.02.05 15:31 
Larus hat folgendes geschrieben:
Wie kann ich eine Form in eine DLL einbinden und zur laufzeit vom Programm aufrufen lassen?

Siehe hier das DLL Tutorial von Assarbad: www.luckie-online.de...hi/Importe/Assarbad/
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Mo 14.02.05 18:49 
Titel: kk
kk machen wirs ma