Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi [GELÖST] Create FIniFile führt zu Exception mit CoolTrayIcon (https://www.delphipraxis.net/94975-%5Bgeloest%5D-create-finifile-fuehrt-zu-exception-mit-cooltrayicon.html)

Hiele 28. Jun 2007 19:35


[GELÖST] Create FIniFile führt zu Exception mit CoolTrayIcon
 
Hallo Zusammen,

ich bekommes es einfach nicht hin, ein INI File zu lesen.
Mein Programm nutzt CoolTrayIcon und im Zusammenhang mit Create
für TIniFile kommt es so fort zum bekannten Fehler das das Parent fehlt.

Habe ja alles hier dazu im Forum gefunden. Dank der Suche.

Aber TInifile hat kein parent. Undefinierter Bezeichner.


Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  CoolTrayIcon1.IconVisible := True;

  try
    Ini:=TIniFile.Create(ExtractFilePath(ParamStr(0)) +  'hstray.ini');
    ini.parent := Selft; <----- GEHT NICHT :-(
    tcpclient.Host := ini.readstring('Homeserver','IP','0.0.0.0');
    tcpclient.Port := ini.readinteger('Homeserver','Port',0);
  finally
    Free;
  end;


  HSIP.Text := tcpclient.Host;
  HSPORT.Text := InttoStr(tcpclient.Port);
end;

Ohne CoolTrayIcon läuft der Ini Kram und auch umgekehrt - aber zummen nicht.

Habe ich da was übersehen?

Für ein Tip wäre ich Dankbar


Gruß
Hiele



EDIT:

Manchmal sieht man den Wald vor lauter Bäumen nicht!!
Das kommt vom Kopieren

Hatte vergessen:

Delphi-Quellcode:
ini.free;
Danke fürs zuhören :oops:


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:39 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz