Get VersionInfo from resource file (2)

Roberto Rocco already give us a class to get version information from module
resources (.exe, .dll, etc.) it works great for the fixed information but
you have to know the language-charset of the module for retrieving language
dependant information.

My class, CFileVersion, allow you to get fixed and the language dependant
information. The class use the first language-charset available from the
module, so you don't have to worry about it.

Some of the most use information have predefined method like
GetFileVersion(), GetCompanyName(), etc. You can also use QueryValue() if
you need to get uncommon or custom data, or if you really want to get data
from a specific language-charset.

You don't have to explicitly add version.lib on your project setting, a
pragma directive take care of it.

Comments

Unfortunately, this doesn't work if version info is broken.

Posted by vsoft44
on 08/03/2004 12:53pm

There exists at least one exception: Windows Media Player Ver 7.10.00.3059 which is installed in my PC. Its StringInfoSection contains 040904E4 language-codepack tag, while Translation section claims that another character set is used: 040904B0.
Then QueryValue returns an empty string. At the same time, Windows Explorer shows Product Description string in file properties dialog. How?

Top White Papers and Webcasts

Live Event Date: March 19, 2015 @ 1:00 p.m. ET / 10:00 a.m. PT
The 2015 Enterprise Mobile Application Survey asked 250 mobility professionals what their biggest mobile challenges are, how many employees they are equipping with mobile apps, and their methods for driving value with mobility.
Join Dan Woods, Editor and CTO of CITO Research, and Alan Murray, SVP of Products at Apperian, as they break down the results of this survey and discuss how enterprises are using mobile application management and private …

On-demand Event
Event Date: February 12, 2015
The evolution of systems engineering with the SysML modeling language has resulted in improved requirements specification, better architectural definition, and better hand-off to downstream engineering. Agile methods have proven successful in the software domain, but how can these methods be applied to systems engineering? Check out this webcast and join Bruce Powel Douglass, author of Real-Time Agility, as he discusses how agile methods have had a tremendous …