resources

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thorsten Kiefer

    resources

    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

  • Alf P. Steinbach

    #2
    Re: resources

    * 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?

    Comment

    • Jim Langston

      #3
      Re: resources

      "Thorsten Kiefer" <toki782@usenet .cnntp.orgwrote in message
      news:45fdb2d7$0 $28265$6e1ede2f @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.


      Comment

      Working...