| View previous topic :: View next topic |
| Author |
Message |
Chri Guest
|
Posted: Thu May 06, 2004 1:03 pm Post subject: Resource |
|
|
I've created a resource.rc file and I've included in my project. All run
well but when I produce the ".exe" and install the program in an other pc it
need all the bitmap I've included in the resource file. Is there a way to
"Store" the resource file inside the .exe?
Thanks, Chri.
|
|
| Back to top |
|
 |
Michel Leunen Guest
|
Posted: Thu May 06, 2004 6:20 pm Post subject: Re: Resource |
|
|
Chri wrote:
| Quote: | I've created a resource.rc file and I've included in my project. All run
well but when I produce the ".exe" and install the program in an other pc it
need all the bitmap I've included in the resource file. Is there a way to
"Store" the resource file inside the .exe?
|
Weird! At link time, resources ARE included in the executable.
How did you add the .rc file to your project. The way to do it is
Project/Add to Project, select your .rc file and click on Add.
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
|
|
| Back to top |
|
 |
Chri Guest
|
Posted: Fri May 07, 2004 6:34 am Post subject: Re: Resource |
|
|
Yes it's added to the project how you said but at run time it need bitmap in
the folder...
"Michel Leunen" <mleu (AT) NOSPAMskynet (DOT) be> ha scritto nel messaggio
news:409a81f7$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Chri wrote:
I've created a resource.rc file and I've included in my project. All run
well but when I produce the ".exe" and install the program in an other
pc it
need all the bitmap I've included in the resource file. Is there a way
to
"Store" the resource file inside the .exe?
Weird! At link time, resources ARE included in the executable.
How did you add the .rc file to your project. The way to do it is
Project/Add to Project, select your .rc file and click on Add.
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
|
|
|
| Back to top |
|
 |
Michel Leunen Guest
|
Posted: Fri May 07, 2004 5:40 pm Post subject: Re: Resource |
|
|
Chri wrote:
| Quote: | Yes it's added to the project how you said but at run time it need bitmap in
the folder...
|
And how do you load the bitmap at runtime? Do you use the
LoadFromResourceName() method of TBitmap?
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
|
|
| Back to top |
|
 |
Chri Guest
|
Posted: Sat May 08, 2004 11:00 am Post subject: Re: Resource |
|
|
Yes maybe I have to use LoadFromResourceId....
isn't it?
Ciao and thanks.
"Michel Leunen" <mleu (AT) NOSPAMskynet (DOT) be> ha scritto nel messaggio
news:409bca15$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Chri wrote:
Yes it's added to the project how you said but at run time it need
bitmap in
the folder...
And how do you load the bitmap at runtime? Do you use the
LoadFromResourceName() method of TBitmap?
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
|
|
|
| Back to top |
|
 |
Michel Leunen Guest
|
Posted: Sat May 08, 2004 12:17 pm Post subject: Re: Resource |
|
|
Chri wrote:
| Quote: | Yes maybe I have to use LoadFromResourceId....
isn't it?
|
Use it like this:
In your file.rc
#include "resource.rh"
ID_BMP BITMAP "your_bitmap.bmp"
in resource.rh
#define ID_BMP 100
And in your .cpp file:
Graphics::TBitmap *bmp = new Graphics::TBitmap;
bmp->LoadFromResourceID((int)HInstance,ID_BMP);
....
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
|
|
| Back to top |
|
 |
|