
CVersionInfo
v1.02 An MFC 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
MFC 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.0 (10 April 2000)
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.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