Are there some preprocessor keywords to use to access the FILEVERSION defined in my .rc file at compile time?
I don't really want to add extra code to read the file information from the compiled product itself.
Are there some preprocessor keywords to use to access the FILEVERSION defined in my .rc file at compile time?
I don't really want to add extra code to read the file information from the compiled product itself.
The preprocessor runs on the .RC file as well. Define the shared data in a header that is included by both the .RC and your source code.
i.e., in foo.h:
#define MY_PRODUCT_NAME Foo
Then in the foo.rc:
#include "foo.h"
VS_VERSION_INFO VERSIONINFO
// Many lines omitted
VALUE "ProductName", MY_PRODUCT_NAME
Then in foo.cpp:
#include "foo.h"
cout << MY_PRODUCT_NAME;