Board index » delphi » Help! Installing component in Delphi/C++Builder

Help! Installing component in Delphi/C++Builder

I've been trying to create my own component in C++Builder and
I can't seem to get bitmaps to display properly.  I loaded the bitmap
from a .RES file I created in Image Editor. Then I added it to a
TImageList Object using the AddMask method. When I compile and run it
normally, it works fine. When I try to install it in the component
palette it compiles fine, but then when I add it to a new form it locks
up with an Access Violation at some weird address.

I spent a long time debugging it, but the only way I could get it to
stop was to use the Windows API function LoadBitmap in place of
TBitmap::LoadFromResourceName. I also had to resized at least one of the
graphics to 16x16 because it got loaded as a 14x14 (????). Now it
compiles and runs fine, but it fails to load the bitmaps into the
TImageList.

This seems like a bug in C++Builder. Does anyone know the answer to
this? Is there a bug fix out there? Help anyone?

Thanks,

Geoff Hardy
ha...@main.daily.umn.edu

 

Re:Help! Installing component in Delphi/C++Builder


Quote
Geoff Hardy wrote:

> I've been trying to create my own component in C++Builder and
> I can't seem to get bitmaps to display properly.  I loaded the bitmap
> from a .RES file I created in Image Editor. Then I added it to a
> TImageList Object using the AddMask method. When I compile and run it
> normally, it works fine. When I try to install it in the component
> palette it compiles fine, but then when I add it to a new form it locks
> up with an Access Violation at some weird address.

> I spent a long time debugging it, but the only way I could get it to
> stop was to use the Windows API function LoadBitmap in place of
> TBitmap::LoadFromResourceName. I also had to resized at least one of the
> graphics to 16x16 because it got loaded as a 14x14 (????). Now it
> compiles and runs fine, but it fails to load the bitmaps into the
> TImageList.

> This seems like a bug in C++Builder. Does anyone know the answer to
> this? Is there a bug fix out there? Help anyone?

> Thanks,

> Geoff Hardy
> ha...@main.daily.umn.edu

Here's an extract from the Delphi 3.0 README.TXT file. Though I'm not
sure, this statement may provide a hint:

   "Due to an operating-system bug, the TImageList.ResourceLoad
    method does not load Icon or Cursor files."

Best regards,

   Hans

-----------------------------------
  Hans Lohninger
  Vienna University of Technology
  Institute of General Chemistry
  Getreidemarkt 9/152
  A-1060 Vienna, Austria
  hlohn...@email.tuwien.ac.at
  http://qspr03.tuwien.ac.at/lo/
  http://www.lohninger.com/
  phone: ++43-1-58801-5048
  fax: ++43-1-581-1915
-----------------------------------

Other Threads