views:

27

answers:

3

How can I programmatically read what version of software I am using?

If I use MSVS to create a project, and that project includes a resource (.rc) file and the version is specified in that file, how can I use code to "read" the version information?

IE. If I want the software to report what version it is when it is run, and the only place this information is stored is in the rc file, what can I do?

Thanks!

R

A: 

Assuming that you are using VERSIONINFO in your resource files, use these functions.

In silico
A: 

You can use GetFileVersionInfo with the name of the current executable/dll to read the version information, which was embedded into the exe/dll when it was built from the resource file.

Saxon Druce
+1  A: 

You want to use GetFileVersion() and related functions.

jeffamaphone