DevC++ and string tables
Since DevC++ doesnt have a resource editor like VC++ 6.0, how can I make string tables in DevC++?
You can either download a third party resource editor or write one yourself manually in a created resource file.
Something like the following:
Something like the following:
STRINGTABLEBEGIN//Attention StringsID_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
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:
So, a good string table resource file might look like:
// File resources.rc#include "resource.h"STRINGTABLE DISCARDABLEBEGIN IDS_STRING1 "String 1" IDS_STRING2 "String 2" ... IDS_STRING16 "String 16"ENDSTRINGTABLE DISCARDABLEBEGIN IDS_STRING17 "String 17" ... IDS_STRING32 "String 32"END...// File resource.h#define IDS_STRING1 1001#define IDS_STRING2 1002...
theres an extention of GNU's GCC where you can make string tables in the code itself:
Can someone confirm if VC++ can do something similiar?
const char * table[] = { "string one", "thing two", "your mother."};
Can someone confirm if VC++ can do something similiar?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement