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

  • When it comes to desktops – physical or virtual – it's all about the applications. Cloud-hosted virtual desktops are growing fast because you get local data center-class security and 24x7 access with the complete personalization and flexibility of your own desktop. Organizations make five common mistakes when it comes to planning and implementing their application management strategy. This eBook tells you what they are and how to avoid them, and offers real-life case studies on customers who didn't let …

  • The exponential growth of data, along with virtualization, is bringing a disruptive level of complexity to your IT infrastructure. Having multiple point solutions for data protection is not the answer, as it adds to the chaos and impedes on your ability to deliver consistent SLAs. Read this white paper to learn how a more holistic view of the infrastructure can help you to unify the data protection schemas by properly evaluating your business needs in order to gain a thorough understanding of the applications …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds