Jump to content
  • Advertisement
Sign in to follow this  
Fixxer

DevC++ and string tables

This topic is 4861 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

Since DevC++ doesnt have a resource editor like VC++ 6.0, how can I make string tables in DevC++?

Share this post


Link to post
Share on other sites
Advertisement
You can either download a third party resource editor or write one yourself manually in a created resource file.

Something like the following:

STRINGTABLE
BEGIN
//Attention Strings
ID_STRING_HI "Hello World!"
ID_STRING_BYE "Goodbye World!"
ID_STRING_STUFF "Calculating..."
ID_STRING_FOO "To be truthful, I do not know what foo is"
ID_STRING_ERROR "Something hurts!"
...
END

Share this post


Link to post
Share on other sites
A couple of things to keep in mind: For some bizarre reason, Windows limits you to 16 strings per table. Secondly, you should probably make the string table discardable, which tells Windows that the memory can move around if need be. Finally, in order to do something like what Xiachunyi suggested, you'll need to #define the IDs somewhere.

So, a good string table resource file might look like:

// File resources.rc
#include "resource.h"

STRINGTABLE DISCARDABLE
BEGIN
IDS_STRING1 "String 1"
IDS_STRING2 "String 2"
...
IDS_STRING16 "String 16"
END

STRINGTABLE DISCARDABLE
BEGIN
IDS_STRING17 "String 17"
...
IDS_STRING32 "String 32"
END
...

// File resource.h
#define IDS_STRING1 1001
#define IDS_STRING2 1002
...

Share this post


Link to post
Share on other sites
theres an extention of GNU's GCC where you can make string tables in the code itself:
const char * table[] = {
"string one",
"thing two",
"your mother."
};

Can someone confirm if VC++ can do something similiar?

Share this post


Link to post
Share on other sites
Now if i were to make that string table, and use it for a DLL file full of functions to use in a bunch of different language, I would just need to call the function?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!