CVersionInfo
v1.13 A C++ class to encapsulate the Windows Version API
This simple little class encapsulates the SDK calls which access version info
from Win32 files. Most executables and DLL's have a VS_VERSION_INFO resource associated
with them and this class provides a simple C++ class to programmatically access
this information.
Features
- Code is UNICODE enabled and build configurations are provided.
- All code compiles cleanly at level 4.
- Small footprint, total size amounts to just c. 300 lines of code.
The enclosed zip file contains the CVersionInfo
source code, documentation and a simple MFC dialog based app which allows the version
info details of any file to be displayed.
Copyright
- You are allowed to include the source code in any product (commercial, shareware,
freeware or otherwise) when your product is released in binary form.
- You are allowed to modify the source code in any way you want except you
cannot modify the copyright details at the top of each module.
- If you want to distribute source code with your application, then you are
only allowed to distribute versions released by the author. This is to maintain
a single distribution point for the source code.
Updates
v1.13 (7 February 2022)
- Updated the code to use C++ uniform initialization for all variable
declarations.
- Updated copyright details.
v1.12 (12 April 2020)
- Fixed more Clang-Tidy static code analysis warnings in the code.
v1.11 (14 March 2020)
- Updated copyright details.
- Fixed more Clang-Tidy static code analysis warnings in the code.
v1.10 (21 December 2019)
- Fixed various Clang-Tidy static code analysis warnings in the code.
v1.09 (21 April 2019)
- Updated copyright details.
- Removed the code path supported by the non defunct
CVERSIONINFO_MFC_EXTENSIONS define
v1.08 (16 September 2018)
- Fixed a number of compiler warnings when using VS 2017 15.8.4
v1.07 (4 June 2018)
- Updated copyright details.
- Fixed a number of C++ core guidelines compiler warnings. These
changes mean that the code will now only compile on VC 2017 or later.
v1.06 (26 September 2017)
- Updated copyright details.
- Replaced NULL throughout the codebase with nullptr. This means that the
minimum requirement for the framework is now VC 2010.
- Replaced CString::operator LPC*STR() calls throughout the codebase
with CString::GetString calls
- Made all the Get* methods const.
v1.05 (2 January 2016)
- Updated copyright details.
- CVersionInfo::GetValue now uses wostringstream and ostringstream instead
of wstringstream and stringstream.
v1.04 (29 November 2015)
- Updated the code to clean compile in VC 2015.
- Reworked the classes to optionally compile without MFC. By default the class
now use STL classes and idioms but if you define CVERSIONINFO_MFC_EXTENSIONS
the class will revert back to the MFC behaviour.
- All the class methods have had SAL annotations added
v1.03 (4 January 2015)
- Updated the code to clean compile in VC 2010 - VC 2013.
- Updated copyright details.
- Replaced all TRACE calls with ATLTRACE.
v1.02 (14 September 2008)
- Updated copyright details.
- Code now compiles cleanly using Code Analysis (/analyze)
- Updated code to compile correctly using _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
define
- Updated sample app to clean compile on VC 2008
- The code has now been updated to support VC 2005 or later only.
- Removed VC 6 style AppWizard comments from the code.
- Reworked code to use ATL::CHeapPtr for required memory allocations
v1.01 (7 July 2006)
- Updated copyright details
- Updated the code to clean compile on VC 2005
- Addition of CVERSIONINFO_EXT_CLASS and CVERSIONINFO_EXT_API macros to allow
the class to be easily added to an extension DLL.
- Optimized CVersionInfo constructor code
- Reviewed all TRACE statements for correctness
- Updated the documentation to use the same style as the web site.
v1.0 (10 April 2000)