lmengyew
lmengyew

Reputation: 371

How do I use a macro in the data portion of a resource script?

I have the following macros header file (system.h),

#define rt_metadata 8000
#define dir_metadata "db\metadata"

and resource file (system.db.metadata.rc)

#include "system.h"
SY_ALLOWDATE   rt_metadata    db\metadata\SY.AllowDate.xml 

How do I replace the db\metadata with dir_metadata in the resource file so that it will become something like dir_metadata\SY.AllowDate.xml?

Upvotes: 2

Views: 219

Answers (1)

Ken White
Ken White

Reputation: 125679

This is done by the resource compiler (BRCC32.EXE was Borland's version, and Microsoft had one as well).

Macros are done by a precompiler just before compiling; BRCC32 handled both the precompilation and compilation steps of converting an RC file into a binary RES file.

So you can get the macro converted by using the commandline resource compiler:

brcc32 yourresourcefile.rc

You can also define the macro on the commandline as well

brcc32 -dYOURMACRO=yourstring yourresourcefile.rc

Upvotes: 1

Related Questions