Resource files


#1

I’m porting an old project to Juce at present and I’m just looking for advice on the best way to tackle a particular issue. My non-juce application would launch, read some binary info that was stored in the executable and then depending on the information received would create x number of controls. Users could then make some changes to the number of controls during runtime and hit save which would overwrite the old binary data with new data so then next time the user launched the application the changes would show up. This was all very hackish and I’m looking for a better way. I want to embed the data in the executable so the application is not dependant on external files. I’ve read on the list about embedded resource files and I’ve played around with the jucer to see how this is done. It seems relatively straightforward to add a resource but how does one load it within an application, edit it and save/overwrite the original one? Is this even possible? And if so is it a cross-platform solution? Any help or suggestions to which classes I should look at etc. are much appreciated.


#2

…the binary resources are compiled into the exe - they’re a piece of c++ code! Good luck trying to get your exe to dynamically recompile data into itself!

Best way to do it is just to dump it into a file the first time the app runs, and use that.


#3

Thanks, I’ll try that, the only thing is I want to embed it back into the exe when it’s done. I might change tac here and forget about that feature. It was a real pain to implement in my previous project…


#4

Oh, sorry, maybe I misunderstood you - do you just mean how do you edit the resource from the jucer? If so it’s easy - just edit the original file and click on the reload button to refresh it.