Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem using TPicture.LoadFromFile in D3 Thread

5 views
Skip to first unread message

Heinz Schiffmann

unread,
May 15, 1998, 3:00:00 AM5/15/98
to

I've written a Thread that populates a TImageList with images
of a given directory that works quite well - in D2.

Using the same code in D3, i've nothing but problems executing
certain methods like

TPicture.LoadFromFile(...);
TPicture.Free;
TBitmap.Canvas.FillRect(...);

Looks like i'm missing something about D3.
How can i get that to work in both D2/D3 ?

Here some code:

//-------------------------------------------------------------
constuctor TPopulateImageListThread.Create(...);
begin
inherited Create(false);
FreeOnTerminate := true;
FPicture := TPicture.Create;
FFiles := TStringList.Create;
FFiles.Assign(...);
FImageList := TImageList.Create;
...
end;

destuctor TPopulateImageListThread.Destroy;
begin
...
FFiles.Free;
FPicture.Free; <- Crashes in D3
FImageList.Free;
inherited Destroy;
end;

procedure TPopulateImageListThread.Execute;
var
i: Integer;
begin
for i := 0 to FFiles.Count -1 do
begin
try
FPicture.LoadFromFile(FFiles.Strings[i]); <- Crashes in D3
...
except
end;
...
end;
end;
//-------------------------------------------------------------

Thanks in advance

Heinz Schiffmann

Dale McGary

unread,
May 19, 1998, 3:00:00 AM5/19/98
to

Make sure you are using the latest updates available. 3.02 I believe. There
was a locking problem (I think with canvases), that was fixed in one of the
updates.

Dale McGary

Heinz Schiffmann wrote in message <355C7639...@mail.augustanet.de>...

Heinz Schiffmann

unread,
May 25, 1998, 3:00:00 AM5/25/98
to

Dale,

many thanks for that hint - the 3.02 update solved the problem.

Heinz Schiffmann

Johann Edward

unread,
May 27, 1998, 3:00:00 AM5/27/98
to

How do you know what release of delphi you have?
Mine says 3.0.5.53
Regards,J

Heinz Schiffmann wrote in message <35693F2A...@mail.augustanet.de>...

Peter Below

unread,
May 27, 1998, 3:00:00 AM5/27/98
to

> How do you know what release of delphi you have?
> Mine says 3.0.5.53

Check the file date/time of your Delphi EXE, the time part encodes the
version.

Peter Below (TeamB) 10011...@compuserve.com)


0 new messages