usually you place the version in the VersionInfo entry in the .rc of your project so that the version number is known to the system, for example. when copying a file.
If you need a version number inside your program, then the easiest way is to create the header that you defined with the version number
#define VER_FILEVERSION 1,0,0,0 #define VER_FILEVERSION_STR "1.0.0.0\0" #define VER_PRODUCTVERSION 1,0,0,0 #define VER_PRODUCTVERSION_STR "1.0\0"
then include this header both in the .rc file and in the file in which you need it.
source share