Autor Beitrag
Andidreas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114

Windows XP Pro
BDS 2006
BeitragVerfasst: So 10.09.06 16:50 
Ich lasse zur Laufzeit ein Formular erstellen. Dieses soll, wenn das entsprechende Editierfeld geschlossen wird, aus dem Speicher entfernt werden, aber wenn nötig wieder erstellt werden können. Alles was ich probiert hab, führt zu Fehlermeldungen. Wie kann/oder muß ich das anstellen, damit das klappt?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 10.09.06 16:52 
Theoretisch sollte das gehen. Zeig mal deinen Code bei dem es nicht geht.

_________________
Markus Kinzler.
Andidreas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114

Windows XP Pro
BDS 2006
BeitragVerfasst: So 10.09.06 16:57 
Erstellen:
Form2 := TForm2.Create(Application);
Form2.Funktionen(ChangeFileExt(DateiScript, '.map'));
Form2.Show;

Löschen:
Form2.Free;
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 10.09.06 17:01 
In diesem fall wäre besser
ausblenden Delphi-Quelltext
1:
if Form2 = Nil then Form2 := TForm2.Create(Nil);					


und
ausblenden Delphi-Quelltext
1:
if Form2 <> Nil then Form2.FreeAndNil;					

zu nehmen.
Was für ein Fehler kommt den?

_________________
Markus Kinzler.
Andidreas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114

Windows XP Pro
BDS 2006
BeitragVerfasst: So 10.09.06 17:16 
Fehlermeldung:
user defined image

Form2.FreeAndNil; ist nicht nur
ausblenden Delphi-Quelltext
1:
FreeAndNil(Form2);					
Andidreas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114

Windows XP Pro
BDS 2006
BeitragVerfasst: So 10.09.06 17:49 
:autsch: :autsch: Erlegigt: ich doofe Nuß hab nur einer Variablen den falschen Wert zugewiesen.
Danke für Deine Bemühungen.