CWinApp-derived Class for Retrieving Version Information

This class was developed for the easy accessing of version information from a resource file. It is derived from CWinApp and implements accessor the function you will most likely need to use. As the code is fairly straightforward, I'll let you look at the source for more information.

Here's all you need to do to use this class:
  1. Add the CVersionApp.cpp and CVersionApp.h to your Project
  2. Derive your CWinApp class from CVersionApp
  3. Call the virtual CVersionApp::InitInstance() function from your CWinApp::InitInstance()

BOOL CYourWinApp::InitInstance()
{
 ....
 return CVersionApp::InitInstance();
}

Downloads

Download demo project - 49 Kb
Download source - 3 Kb



Comments

  • Good, but two proposals

    Posted by Legacy on 05/28/2003 12:00am

    Originally posted by: Thomas Hetzer

    Thanks for the code- it works fine for me. But I have two small recommendations:

    - fix the code for UNICODE projects (a few calls missing the _T("...")).

    - make the get-methods const.


    Best regards,
    Thomas

    Reply
  • ReadFileTime() fails!

    Posted by Legacy on 10/04/2000 12:00am

    Originally posted by: Haragan

    Can't access to EXE file for read time. Open(...) fails ever, and can't retrieve file time.
    
    

    -----
    CFile file;
    if(file.Open(m_VersionInfo.sFilePath,CFile::modeRead,NULL))
    {
    BOOL bRet=GetFileTime((HANDLE)file.m_hFile,&m_CreationTime,&m_LastAccessTime,&m_LastWriteTime);
    file.Close();
    return bRet;
    }
    return FALSE;
    ------

    David.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • With JRebel, developers get to see their code changes immediately, fine-tune their code with incremental changes, debug, explore and deploy their code with ease (both locally and remotely), and ultimately spend more time coding instead of waiting for the dreaded application redeploy to finish. Every time a developer tests a code change it takes minutes to build and deploy the application. JRebel keeps the app server running at all times, so testing is instantaneous and interactive.

  • Live Event Date: April 22, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Database professionals — whether developers or DBAs — can often save valuable time by learning to get the most from their new or existing productivity tools. Whether you're responsible for managing database projects, performing database health checks and reporting, analyzing code, or measuring software engineering metrics, it's likely you're not taking advantage of some of the lesser-known features of Toad from Dell. Attend this live …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds