Board index » delphi » Problem with Loadfromfile

Problem with Loadfromfile

Hi!

I was developing a card game in Delphi 2. I was using 52 bitmaps in
disk (rather then accessing the cards dll), which were loaded during
execution with the method Loadfromfile.

The problem with this was that after a while, resources reduced to a
critical level and the application crashed.

I solved the problem using another approach, but is this a bug
with Loadfromfile?

jasan...@mail.telenet.pt

 

Re:Problem with Loadfromfile


Hi,

I heard about a bug in Delphi 2 with TBitmaps. If you assigned a bitmap to
it, or used the LoadFromResourceName or LoadFromFile method it leaked 1
window handle. Before you load a bitmap, try a DeleteObject(Bitmap.Handle).
This should do the trick...

good luck,
Martijn

--
Martijn Tonies
http://surf.to/seal97

<none of the text written above has got anything to do with Euro Partners
Informatici BV>

System Development
Euro Partners Informatici BV
http://www.euro-partners.nl

Your Name <Yourn...@somwhere.COM> wrote in article
<6l358l$2p...@internet-gw.telecom.pt>...

Quote

> Hi!

> I was developing a card game in Delphi 2. I was using 52 bitmaps in
> disk (rather then accessing the cards dll), which were loaded during
> execution with the method Loadfromfile.

> The problem with this was that after a while, resources reduced to a
> critical level and the application crashed.

> I solved the problem using another approach, but is this a bug
> with Loadfromfile?

> jasan...@mail.telenet.pt

Other Threads