Autor Beitrag
Thunder00
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: Mi 05.02.03 16:54 
Hallo,

Immer wenn ich in Delphi7 in einer onCreate-Procedure einer Form eine andere Form anzeigen will mit Form.Show kommt immer eine ziehmlich lange Fehlermeldung mit verschiedenen Angaben zu Speicherstellen von Delphi.

Was ist da los? Wie kann ich das umgehen??
:?:
Danke im Voraus

_________________
If you can't make it good, at least make it looks good. (Bill Gates)
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Mi 05.02.03 16:56 
Das geht dort noch nicht, du willst im Konstruktor auf Objekte zugreifen, die noch nicht initialisiert sind.
Mach das im OnShow am besten.
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mi 05.02.03 17:32 
hallo,

das kannst du schon, nur darfst du das form nicht im hauptprogramm initialisieren:
ausblenden Quelltext
1:
2:
3:
4:
  // hauptprogramm
Application.CreateForm(TForm1, Form1);  
//Application.CreateForm(TForm2, Form2);  // auto create aus
Application.Run;

dann kansst du in deiner onCreate procedure folgendes tun:
ausblenden Quelltext
1:
2:
Form2 := TForm2.create(self);
Form2.Show;

...musst dann später, wenn dues nicht mehr brauchst, -> Form2.free machen.

viel spass.