By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,406 Members | 1,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,406 IT Pros & Developers. It's quick & easy.

resources

P: n/a
Hi,
how do i bake resources into an executable ?
One way would be to convert binary files into headerfiles like that :

pic1.h:
char *pic1 = {23,45,254,.....};

But is there another way ?

Regards
Thorsten

Mar 18 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* Thorsten Kiefer:
Hi,
how do i bake resources into an executable ?
One way would be to convert binary files into headerfiles like that :

pic1.h:
char *pic1 = {23,45,254,.....};

But is there another way ?
Not in standard C++. But the OS might help. On the Mac each file
traditionally had two forks: code and resources. In Windows executable
files have direct support for resources (both code and resources in the
same fork), but also forks, or as they're in Windows, "streams".

So put this question to an OS-specific group.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Mar 18 '07 #2

P: n/a
"Thorsten Kiefer" <to*****@usenet.cnntp.orgwrote in message
news:45***********************@read.cnntp.org...
Hi,
how do i bake resources into an executable ?
One way would be to convert binary files into headerfiles like that :

pic1.h:
char *pic1 = {23,45,254,.....};

But is there another way ?
One trick that may, or may not, work for you is to write your resources
after the end of the executable. I.E. Compile your program, than tack on to
the end. If you do do this usually the very last 4 (or sizeof int) bytes
are the size of the data written, so you open the executable for reading,
jump to the end, back up 4 bytes, read the number of bytes in the resources,
then offsent to it.

I'm not saying it's a good way, just one way that's done.

Then you have Microsoft who has a resource file that you can put into the
executable.

Myself, I just provide data files along with the executable.
Mar 18 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.