Autor Beitrag
Snoop007
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Do 31.10.02 19:44 
Hi,
wenn ich ein Formular in eine Dll packe kann ich die Form leider nicht aufrufen

kann mir einer bitte helfen ?

Danke !!
Hagbard Celine
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 119



BeitragVerfasst: Fr 01.11.02 10:22 
Snoop007 hat folgendes geschrieben:
Hi,
wenn ich ein Formular in eine Dll packe kann ich die Form leider nicht aufrufen

kann mir einer bitte helfen ?

Danke !!


Poste mal ein wenig Code!

Ist schon ne Weile her, aber wenn Du eine Form in eine Dll packst, wird dann automatisch eine Instanz davon erstellt?? Ich glaube nicht!

Musst also die DLL einbinden und dann eine Instanz deiner Form erzeugen! (Glaube ich!)
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Sa 02.11.02 18:45 
alles ganz einfach: :idea: :roll:
das formular kannst du wie folgt aufrufen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure fensteranzeigen; stdcall;
begin
 form1:=form1.create(application);
   try
     form1.showmodal
   finally
     form1.free
   end
end;


wichtig ist showmodal und nicht show.
bei show wird einfach nur das fenster aufgerufen und sofort wieder geschlosen.
bei showmodal bleibt das form so lange erhalten bis es wieder geschlossen wird.

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
Steffer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 299



BeitragVerfasst: Sa 02.11.02 19:54 
>wichtig ist showmodal und nicht show
Wird wohl der Fehler sein, aber du kannst ja ein Form auch in OnClose() freigeben.

Beispiel zum Form und DLL findest du hier:
www.faqsen.de/find.j...494850485748545252;2

_________________
Keine Signatur ...
Snoop007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: So 03.11.02 00:11 
ich habe das jetzt hinbekommen, das eine Form aus einer dll angezeigt wird aber leider kann ich keine globale variable übergeben

in der dll :
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
procedure benutzer_anzeigen(ort : string); stdcall;
begin
  Form1 := TForm1.Create(nil);
  Form1.ShowModal;
  Form1.merkzettel_ort := ort;
end;


wenn ich erst die variable ort der globalen variabel übergebe und dann showmodal aufrufe erfolgt ein fehler ....

in beiden fällen ist die globale variable leer .....

irgenwie verstehe ich das nicht .....
Steffer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 299



BeitragVerfasst: So 03.11.02 00:36 
Schau dir Modal mal genauer an:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
procedure benutzer_anzeigen(ort : string); stdcall; 
begin 
  Form1 := TForm1.Create(nil); 
  Form1.merkzettel_ort := ort; 
  Form1.ShowModal; 
end;


(03.11.02 12:17 Tino) Code-Tags hinzugefügt.

_________________
Keine Signatur ...
Snoop007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: So 03.11.02 01:34 
es geht aber auch nicht, wenn ich erst die globale variable setze ...
ich erhalte dann eine zugriffsverletzung

ich habe schon die sharemem.pas eingebunden, hilft aber auch nicht
Snoop007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: So 03.11.02 02:00 
ich habe es jetzt hinbekommen, statt stdcall muss register hin

danke für eure hilfe !!
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Do 07.11.02 19:02 
dazu is das forum ja da :P :P

_________________
Patrick
im zweifelsfall immer das richtige tun!!!