
How do you include external resources into the executable ???
I have a text file that contains all the vertices and what not for a large numbre of walls and shapes. the program reads this file in and extracts the info it needs, this allows the world to independent of the code, so that it is not "hard coded".
I know that you can include your textures (bitmap files) into the executable by using resource file. I''ve done that for my textures (bitmaps), but I was wondering if there is a way for me to add the textfile as a "resource" of types to the project so that it isn''t "hard hard coded" to the code but still included with everything else in the executable file.
I want this so that when people downlaod the file it is only one file, not an .exe and a "Data" folder. this was for a Software ENgineering class project and there''s website to down load the program.
Any help would be much apprieciated!!!

why dont you just put it in a zip for others to download?
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
Or you could even use an installer program, but if the file is included as a resource, that meens then that it mineaswell be hard coded because once you compile it, it would be part of the exe anyway
[edited by - yodaman on April 2, 2003 4:30:51 PM]
[edited by - yodaman on April 2, 2003 4:30:51 PM]
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
There is a raw resource type iirc, and you can use the WinAPI to load ''raw resources'' as binary data which you could then read as text data.
No idea on the API calls used etc but its a place to start I guess.
No idea on the API calls used etc but its a place to start I guess.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Not sure if it''s what you''re looking for...but...
Your application already has a resource where you''re storing your Bitmaps correct? In that case (assuming your using VC++), go into your resource tab, and right click the top level. "Insert..." should be available. Then you''ll get a dialog. You can insert a "String Table." Do this.
Then add your strings and set the IDS_MyName (resource names) to something useful, not IDS_STRING001 etc...use IDS_ErrorNoFile.
Then you can read those strings with:
There are other methods to open the strings from a resource not compiled into your application (using LoadStringResource or LoadString). The CString method is just easier if you''re reading right out of your own App.
- sighuh?
Your application already has a resource where you''re storing your Bitmaps correct? In that case (assuming your using VC++), go into your resource tab, and right click the top level. "Insert..." should be available. Then you''ll get a dialog. You can insert a "String Table." Do this.
Then add your strings and set the IDS_MyName (resource names) to something useful, not IDS_STRING001 etc...use IDS_ErrorNoFile.
Then you can read those strings with:
CString szString;szString.LoadString(IDS_MyName);
There are other methods to open the strings from a resource not compiled into your application (using LoadStringResource or LoadString). The CString method is just easier if you''re reading right out of your own App.
- sighuh?
- sighuh?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement