Autor Beitrag
Comp-Freak
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 89



BeitragVerfasst: Sa 12.05.07 08:43 
der code in oncreate gibt mihr einen abstrakten fehker:
ausblenden Delphi-Quelltext
1:
2:
3:
 allowedhosts := tstrings.Create;
 allowedhosts.LoadFromFile('Hosts.txt');
 adminpanel.ListBox1.items := allowedhosts;

adminpanel ist eine form und allowedhosts ist in den variablen als tstrings erwahnt worden. Wenn ich den code vom adminpanel ausrufe dan klappts...

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 12.05.07 08:52 
Wenn diese Form vor Adminpanel erstellt wird, dann kann das nicht funktionieren, weil Adminpanel noch gar nicht existiert.

Lösung:
1. Erstellungsreihenfolge der Forms umstellen.
2. Nicht OnCreate, sondern OnShow oder OnActivate verwenden.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Comp-Freak Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 89



BeitragVerfasst: Sa 12.05.07 10:10 
jezt haengt er sich bei allowedhosts.LoadFromFile('Hosts.txt'); auf. *humpf* geschiet ihm recht :).

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Dezipaitor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 220



BeitragVerfasst: Sa 12.05.07 12:18 
versuch mal
ausblenden Delphi-Quelltext
1:
allowedhosts := TStringList.Create;					


du solltest natürlich dann auch den Typ ändern.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 12.05.07 12:38 
Verwende direkte Pfade und nicht nur 'Host.txt'. Die sucht er dann z.B. im Windows-Verzeichnis, etc.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Comp-Freak Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 89



BeitragVerfasst: Sa 12.05.07 12:46 
oh, danke es klappt :)
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 12.05.07 13:08 
Nur darauf achten, dass die Pfade nicht 100% direkt sind, also nicht C:\MyFolder\ verwenden, weil andere User dann z.B. Laufwerk E: benutzen. Dateien sollten im Anwendungsverzeichnis abgelegt werden, welches mit der Funktion Suche in der Entwickler-Ecke GETSPECIALFOLDER ermittelt werden kann.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Dezipaitor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 220



BeitragVerfasst: Sa 12.05.07 20:30 
woran lags nun?
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 12.05.07 20:35 
Wenn ich aus seiner Reaktion schließen: Es lag daran, dass er keinen direkten Pfad verwendet hat.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Comp-Freak Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 89



BeitragVerfasst: So 13.05.07 04:13 
user profile iconGTA-Place hat folgendes geschrieben:
Wenn ich aus seiner Reaktion schließen: Es lag daran, dass er keinen direkten Pfad verwendet hat.

100% richtig (bin eben bloed...)