Re: dynamic creating Timage, win98 vs xp problem



damian wrote:
Hi,
after pressed button1 on windows XP a have see bitmap image (everything
works), but under windows 98 when i clicked on button1 - application is
hanging , all windows 98 not responding. Who helps me ?. I'm using delphi
7 prof.


var cbs2 : array of Timage;

procedure TForm1.Button1Click(Sender: TObject);
begin
 SetLength ( cbs2, length(cbs2)+1 );
 cbs2[0]:= Timage.Create ( Self );
 cbs2[0].Picture.LoadFromFile('node_my_czerwony.bmp');
 cbs2[0].Top:=20;
 cbs2[0].left:=20;
 cbs2[0].Parent:=form1;
end;

i think you should do some work on your code and start plugging up the leaks before you sink.
indexing [0] each time as your array grows sure isn't doing the
last object any good by over writing its pointer and make it fade
away in resource land!


.


Quantcast