Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Grabing resources off a program  (Read 954 times)

thirdbanana

  • 8 MB
  • **
  • Posts: 14
Grabing resources off a program
« on: October 10, 2024, 07:49:11 PM »

Long time ago, I wrote a program in Think C (hence my question in another thread), which I recently found, or at least some fragments. And a compiled version of the code. If I want to compile the code again, I will need the graphics and sound resources; can I fetch them off the executable file (i.e. program) using resedit or something like that?
Logged

Knezzen

  • Staff Member
  • 1024 MB
  • ******
  • Posts: 1218
  • Pro Tools Addict!
    • Macintosh Garden
Re: Grabing resources off a program
« Reply #1 on: October 10, 2024, 10:30:59 PM »

Yeah, that works for sure.
Logged
Pro Tools addict and staff member at Mac OS 9 Lives!, System 7 Today and Macintosh Garden.

Bolkonskij

  • Staff Member
  • 256 MB
  • *****
  • Posts: 278
    • Cornica.org
Re: Grabing resources off a program
« Reply #2 on: October 11, 2024, 05:39:18 AM »

If you added them via ResEdit before, you should be able to open up your resource file and get them out again. Also, while I don't remember any name, there's little applications that do that for you as well. You may want to check the Macintosh Garden for them, they're definitely there.
Logged

thirdbanana

  • 8 MB
  • **
  • Posts: 14
Re: Grabing resources off a program
« Reply #3 on: October 11, 2024, 10:15:01 AM »

If you added them via ResEdit before, you should be able to open up your resource file and get them out again. Also, while I don't remember any name, there's little applications that do that for you as well. You may want to check the Macintosh Garden for them, they're definitely there.

I am not sure; I know I used Think C 5.0 (I actually wrote in the code when I bought it, as it required some changes). I do not remember how the resources were fed: I want to say they were in a separate file which was then added into the binary somehow. Being able to save the resources will help a lot: while I have the original image file (before the different bits were cropped and added as individual components), the floppy I found was not the one I used to build it, so it has some missing files namely the resource and the header file. There is also a programname.mac file which I have no idea of what it is supposed to do.

My plan now is to get it such that it will successfully compile in Think C 5 (which I hope runs in OS9). Then I can decide if I want to switch to codewarrior or whatever, and clean the code some.  :-[
Logged

Bolkonskij

  • Staff Member
  • 256 MB
  • *****
  • Posts: 278
    • Cornica.org
Re: Grabing resources off a program
« Reply #4 on: October 12, 2024, 01:16:26 AM »

Traditionally, when programming the Mac, you would have created an empty resource file and then manually added your resources (pictures, sounds, windows, menu bars, constants etc.) to it which you'd later reference in code. So, in theory, you just need to fire up ResEdit and open the resource file located somewhere in the source folder. From there, you should be able to copy + paste stuff to where you need it. (provided the resource file actually IS in the sources folder)

As for other options, I've run into this application here on Garden:

http://macintoshgarden.org/apps/37thresex

It might do the trick for you, but I have no experience using it myself!
« Last Edit: October 12, 2024, 03:08:05 AM by Bolkonskij »
Logged

ssp3

  • 512 MB
  • *****
  • Posts: 908
Re: Grabing resources off a program
« Reply #5 on: October 12, 2024, 08:14:43 AM »

As for other options, I've run into this application here on Garden:

http://macintoshgarden.org/apps/37thresex

It might do the trick for you, but I have no experience using it myself!

Kagi and serial numbers. Eek!
Nothing comes close to the ResEdit.
Logged
If you're not part of the solution, you're part of the problem.

joevt

  • 64 MB
  • ****
  • Posts: 102
  • New Member
Re: Grabing resources off a program
« Reply #6 on: October 12, 2024, 11:56:09 AM »

Nothing comes close to the ResEdit.
I think Resorcerer has better templates and editors than ResEdit.
It has other features such as being able to look at the ROM resources.
Logged

robespierre

  • 128 MB
  • ****
  • Posts: 151
  • malfrat des logiciels
Re: Grabing resources off a program
« Reply #7 on: October 12, 2024, 12:43:17 PM »

When using MPW to do traditional Mac development, the tools called "Rez" and "DeRez" were used in a build script to add resources to an application. The source for the resources were in files with names ending with ".r", which were regular text files.

Lightspeed/THINK C usually used a file ending in ".rsrc" instead, which got merged with the application during the build phase. In this case you would use ResEdit or Resorcerer to create the resources using their templates.
Logged

ssp3

  • 512 MB
  • *****
  • Posts: 908
Re: Grabing resources off a program
« Reply #8 on: October 12, 2024, 01:32:39 PM »

I think Resorcerer has better templates and editors than ResEdit.
It has other features such as being able to look at the ROM resources.

Of course it does, but it wasn't free, like ResEdit. (I know, I know  ;) )
Logged
If you're not part of the solution, you're part of the problem.

thirdbanana

  • 8 MB
  • **
  • Posts: 14
Re: Grabing resources off a program
« Reply #9 on: October 16, 2024, 02:40:44 AM »

Lightspeed/THINK C usually used a file ending in ".rsrc" instead, which got merged with the application during the build phase. In this case you would use ResEdit or Resorcerer to create the resources using their templates.

Is the ".rsrc" file just the file created in ResEdit with the resources needed by the program? And shouldn't it be added to the project file? I found at the Macintosh Garden the book "Macintosh_C_Programming_Primer_1992.pdf," which is the one I bought (found it in a box but the pdf is more convenient right now), but had not reached the section on building a proper Mac program yet.

Funny you mentioned Lightspeed C; I did have it (v 2.somehing?) before I bought Think C 5.
Logged
Pages: [1]   Go Up

Recent Topics