PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Loading From Resource Files

angedelamort · 21 Nov 2002, 15:16 UTC
Personnaly, I don't like this method (using the .rc). I prefer to put all my external files into a real resources file. It makes the executable smaller.

To do this, write a small program that will be able to append all your files and add some headers to be able to read it after in your code. After that, in FMOD, use the stream function. There are examples with the source code of fmod for reading a stream.

I hope it help you.
Thanks for the replies.

I got this working using Digby's method, but I'd rather have my .wav files in a real resource file rather than in my .exe like angedelamort described.

Could you be more specific and eleborate on what you described angedelamort? I still don't understand how I create this real resource file and then add my files to it like a .rc.

This is my first time working with resource files so sorry if I'm a little slow. :D
I think he's referring to creating one huge data file containing all of your wave file data, and some sort of file directory in a private header of this file so that you can locate an individual wav file within the larger data file.

I've never used FMOD so I can't comment on how that works with this scheme.

If you just want to get the data out of your executable you can still use the resource method you're currently using, but create a resource-only DLL instead. Your exe would then have to call LoadLibrary to load the DLL, then use the returned HMODULE instead of your app's hInstance in the code snippet above.
Thanks Digby.

That's exactly what I was looking for. Works great now!