Sometimes you want to use symbolic names in your resource file, and use the same names in your program to access the resources. To accomplish this, there exists a preprocessor for windres that understands pascal syntax: fprcp. This preprocessor is shipped with the Free Pascal distribution.
The idea is that the preprocessor reads a pascal unit that has some symbolic constants defined in it, and replaces symbolic names in the resource file by the values of the constants in the unit:
As an example: consider the follwoing unit:
unit myunit; interface Const First = 1; Second = 2: Third = 3; Implementation end. |
#include "myunit.pp" STRINGTABLE { First, "hello World !" Second, "hello world again !" Third, "last hello world !" } |
windres --preprocessor fprcp -i myunit.rc -o myunit.res |
In your program, you can then refer to the strings by their symbolic names (the constants) instead of using a numeric index.