I have 2 Visual C++ projects which both have an RC file where the Field Product Version is defined. How can I make both projects to get this version from a global place? Global RC file or what solutions are there?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What works well for me is adding two “Solution Items”. One is a .h file that
#definessome version strings, and another is the .rc file that has an include to the .h andBLOCK "StringFileInfo"that uses the defines.Individual resource files for each project use a
TEXTINCLUDEto bring in the contents of the solution’s .rc.That is a lot to take in. Let me show you what I mean…
1) The two solution items are added as so:
2)
version.hhas some #defines that will be used in VersionInfo.rc23) VersionInfo.rc2 uses the defines
You will want a new line at the end of this file to make the resource compiler happy when it is included in the next step.
Another field you might like to set is “FileDescription” but that is typically on a per-project basis. Remember, this can contain anything you would like to be shared between your projects.
4) Include the VersionInfo.rc2 in each process. This is done by right clicking on the each project’s .rc in the Resource View and selecting Resource Includes.
Add to the Compile-time directives:
#include "../VersionInfo.rc2"This could be done manually by adding the following to the project’s .rc file but it is probably better to let Visual Studio manage everything it can for you.
Phew….that was a mouthful. But now you should be able to change your product versions from one spot.