delphi - Reading ini file onCreate event causes 8 second delay -


i have complex software, , whittled delay in piece of code:

procedure tform1.formcreate(sender: tobject); begin   inherited;   tinifile.create(path + '\filename.ini')     try        checkbox1.checked :=readbool('header','key',true);           free;     end; end; 

when debugging code, debugger showed hanging on create factory of tform

  inherited create(aowner); 

question time: why delphi hang when query ini file? ini file few keys big, standing in 64k windows api limit. oncreate has this?

ini limitations , downsides tinifile class uses windows api imposes limit of 64kb on ini files. if need store more 64kb of data, should use tmeminifile.

update: many comments ill try relate.

i reason blame code, simple "try , see". removed ini file call, on create, , code run smoothly , instant window open. when compiling ini file call on oncreate, software hangs 8 seconds. moved call oncreate constructor create, code works smoothly.

the ini file local file, on local directory, , software 1 calling file, not network file. on drive c\folder\foler\filename.ini, windows.

doing checkbox1.checked := true, gives half second delay(fast). doing

  tinifile.create(path + '\filename.ini')     try            free;     end; 

half second delay, (fast). buy placing code still yields 8 seconds delay. moving code oncreate constructor create half second delay (fast).

so unsure why happening.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -