BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Resource

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Chri
Guest





PostPosted: Thu May 06, 2004 1:03 pm    Post subject: Resource Reply with 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?
Thanks, Chri.


Back to top
Michel Leunen
Guest





PostPosted: Thu May 06, 2004 6:20 pm    Post subject: Re: Resource Reply with quote



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





PostPosted: Fri May 07, 2004 6:34 am    Post subject: Re: Resource Reply with quote



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





PostPosted: Fri May 07, 2004 5:40 pm    Post subject: Re: Resource Reply with quote

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





PostPosted: Sat May 08, 2004 11:00 am    Post subject: Re: Resource Reply with quote

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





PostPosted: Sat May 08, 2004 12:17 pm    Post subject: Re: Resource Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.