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



BeitragVerfasst: Mi 05.03.03 13:35 
Hallo Leute ,

mit folgendem Code versuche ich im ONCreate Ereigniss einer Form die Edit Felder zu füllen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TMatDiaFrm.LoadDefaultSettings;
begin
  Ini := TIniFile.Create('C:\Data.ini');
  OWBox.Text := Ini.ReadString(R.Name,'Mat1','0');
  LWBox.Text := Ini.ReadString(R.Name,'Mat2','0');
  UWBox.Text := Ini.ReadString(R.Name,'Mat3','0');
  RWBox.Text := Ini.ReadString(R.Name,'Mat4','0');
  Ini.Free;
end;

bringt aber beim ersten Editfeld immer eine Fehlermeldung, sieht von euch jemand wieso habe auch schon das OnActivate Ereigniss probiert ist aber auch nicht besser....

Vielen Dank im Voraus

mfg
Ice

Moderiert von user profile iconTino: Code-Tags hinzugefügt.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 05.03.03 13:41 
Hi!

Ich glaube, wir könnten besser helfen, wenn wir die Fehlermeldung kennen würden... :wink:

Cu,
Udontknow
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 05.03.03 13:42 
Hallo,

auf den 1. Blick scheint nichts falsch zu sein. Was ist R.Name? Ist dieser Record (oder eas sonst) initialisert?

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Ice Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114



BeitragVerfasst: Mi 05.03.03 13:57 
Ja initialisiert ist meiner Meinung nach alles,
die Meldung lautet : Exception der Klasse EAccesViolation, Lesen von Adresse .......

Was könnte das sein ? Doch was nicht initialisiert??

mfg
Ice
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 05.03.03 15:11 
Erstellst du Komponenten zur Laufzeit?

Mach mal folgendes:

Setze einen Breakpoint auf die erste Zuweisung ("OWBox.Text:=..."). Starte das Programm. Wenn du am Breakpoint ankommst, gehe mit der Maus auf "OWBox" (nicht auf ".Text"! ). Wenn dort NIL als Hint erscheint, existiert zu dieser Zeit das Editfeld noch gar nicht.

Leider hast du nicht auf Smiegels Frage geantwortet, was R nun ist. Wenn R ein Objekt ist, könnte auch dieses das Problem sein. Gehe auch mal mit dem Mauszeiger auf R.

Cu, :)
Udontknow
Ice Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114



BeitragVerfasst: Mi 05.03.03 16:13 
Sorry , R ist eine Komponente die an anderer Stelle aber vorher zur Laufzeit erstellt wird.

Vielen Dank nochmal für die schnellen antworten..

mfg
Ice
Ice Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114



BeitragVerfasst: Mi 05.03.03 16:17 
Hallo ich nochmal,

ihr hattet Recht r ist noch NIL ..... :shock:

Vielen Dank nochmal!

mfg
Ice