Hamid Reza Hasani
Hamid Reza Hasani

Reputation: 65

How can I use configuration(macro) values in .rc files (vs2010 ro vs2013)?

I want to use some configuration(macro) variables, e.g. $(Configuration) in my .rc file. For example I want to have something like this in my .rc file.

....
....
VALUE "InternalName", "MyProjectName $(Configuration)"
....
....

But, the result, when I see my projects output's properties, is <> rather than <> as I expected!

Is it possible? Note: I need to have different values in different configurations. For example I want to have different application name (that will come in my application properties) in Debug and Release mode.

Upvotes: 0

Views: 1354

Answers (1)

Torq
Torq

Reputation: 26

Define a macro at Resource compiler commandline.

Project properties -> Resources -> General -> "Preprocessor Defines"

CONFIGURATION=$(Configuration);

Use in RC and remember to stringize if used as string.

#define _STRINGIZE(x) #x
#define STRINGIZE(x) _STRINGIZE(x)

VALUE "InternalName", "MyProjectName " STRINGIZE(CONFIGURATION)

Upvotes: 1

Related Questions