Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

soccerman681

How do you include external resources into the executable ???

This topic is 5736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!!!

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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:

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?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!