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

Problem with bitmap-resource in a BPL

35 views
Skip to first unread message

Pascal Joyeux

unread,
Apr 11, 2001, 10:27:43 AM4/11/01
to
Hi there!

I have made a few components who require some bitmaps. These bitmaps are
located in a RES-File wich is linked into the BPL-File at compile time
(using $R). When I drop my component on a form at designtime everything is
fine, and it shows the bitmap. At runtime I'm not able to create and show
the same form because it throws an excpetion telling me that it couldn't
find my bitmap-resource. If i look into the BPL with a ressource grabber i
can see my bitmap but unfortunately it seems to be missing in the EXE that
shows the form. I don't use runtime-Packages so I thought that everything
that is linked into the package (BPL-file) should be linked into the
EXE-file too.

What am I missing ???

thanks for answering

--
Pascal Joyeux
Consultant, Mummert+Partner AG


Robert Cerny

unread,
Apr 11, 2001, 5:06:37 PM4/11/01
to
As a rule of thumb, place the $R directive into the unit where the resource
is used.
This way the unit and the resource stay together, regardless of building
with packages or not. This does not include component images (.DCR) as they
normally aren't used by component code.

Your problem is that linker does not know that your code uses that resource
(as it appears in another unit or in package source), so it doesn't link it
into EXE.
Since it's linked into package, it obviously works at design time.
--
Robert


Pascal Joyeux wrote in message <3ad469cf$1_2@dnews>...

Pascal Joyeux

unread,
Apr 12, 2001, 4:34:18 AM4/12/01
to
Hi Robert!

This was a very good "rule of thumb"!

I had located the $R in the project sourcecode of the BPL (aka as file.BPK).
Now it works!

Thanks again!

0 new messages