Autor Beitrag
Tulkas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 21

WinXP SP2
Delphi7
BeitragVerfasst: Fr 27.10.06 14:31 
Hallo!

Und zwar habe ich folgendes Problem: Ich möchte beim Programmstart (OnCreate des Hauptformulars) überprüfen, ob eine bestimmte Datei vorhanden ist, und wenn nicht diese erstellen und automatisch ein anderes Formular aufrufen.

So habe ich es im Moment:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.FormCreate(Sender: TObject);

begin
  if FileExists('config.cfg') = False then
  begin
  frmConfig.Show;
  FileCreate('config.cfg', fmOpenReadWrite);
  end;
end;


Ich bekomme aber immer beim Start folgende Meldung:
"Zugriffsverletzung bei Adresse 004590C6 im Modul Test.exe. Lesen von Adresse 000002F4"

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: Fr 27.10.06 14:33 
Wo wird frmConfig instanziiert (erzeugt)?
Tulkas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 21

WinXP SP2
Delphi7
BeitragVerfasst: Fr 27.10.06 14:49 
Argh, hat sich schon erledigt, wenn ich es im 'OnShow' des Hauptformulars mache, klappt es :)