Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different version numbers on different configurations

Status
Not open for further replies.

xwb

Programmer
Jul 11, 2002
6,828
0
36
GB
At the moment, I'm building code using the version resources provided by visual studio. What I want to do is to somehow indicate in the version resource which configuration I'm using. All the sources are the same: it is just the library that they link to that is different.

For instance, for

"Debug - OR" configuration, version number should be 1,0,0,OR
"Release - AT" config, version number should be 1,0,0,AT

Is it possible to do this with defines? If so, how do I feed it into the resource compiler.
 
Resource compiler of Open Watcom has command line argument -d for macro definition, the same like C++ compiler has. Dont know about MSVC.
 
MSVC also has a -D or /D for defining macros on the command line. That is not the problem. The problem is the resource file. I have something like

PRODUCTVERSION 1,0,0,1

I can't change that because 1,0,0,1 are two DWORDS. Further down there is something like

VALUE "ProductVersion", "1,0,0,1"

which I'd like to change to

VALUE "ProductVersion", "1,0,0," XXX

where I have -DXXX=OR or -DXXX=AT on the compile line but this just gives me a version number of 1,0,0

What I'd like to know is how I can put a macro into a string in the resource compiler. I just can't get the macros to work in the string section.
 
I never use resource files, so I can't help much there; but just out of curiosity... Why "OR" and "AT"? What do they stand for?
 
It is different CORBA ORBs. I've got

OR = ORBACUS
AT = ACE/TAO
ER = Engine Room
VB = Visibroker

I'm using the same source compiled with different ORBs. If I tick the "ProductVersion" column in explorer, it will tell me the version number. I'm running different ORBs on different machines to see whether the differences in implementation cause any problems.

I could name them differently but that would mean I'd have to set environment variables whenever I changed versions otherwise the batch files won't work. I think it is easier to keep the names the same and just use explorer to tell me which version I'm running.
 
I've worked it out. Set the product version to

VALUE "ProductVersion", ORB

In the compile line, add a define

ORB="79,82,\0" for OR
ORB="65,84,\0" for AT

I noticed that ORB=65 gave the value A. So I tried

1) the equivalent of 65*256+65 to get AA but I got a chinese character instead.
2) ORB="AT\0" but the resource compiler said it didn't understand AT.
3) ORB="\101\124\0" but it got a compilation error.
4) ORB="55,66,77,\0" and I got 7BM - I expected 55,66,77 in explorer.

Since 55,66,77 was decimal for 7BM it figures that it just wants a comma separated list of decimal equivalents of whatever you wish to display.
 
My only problem now is to figure out a method where I can see the resource file in visual studio.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top