Click here to Skip to main content
15,879,095 members
Articles / Desktop Programming / MFC

Auto-Incrementing Build Numbers

Rate me:
Please Sign up or sign in to vote.
4.89/5 (13 votes)
8 Mar 2000 144.7K   2.2K   64  
Describes a way to automatically generate an application build number.
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

//////////////////////////////////////////////////////////////////////
/*
 $History: FileVersion.h $
 * 
 * *****************  Version 3  *****************
 * User: Navis        Date: 6/18/99    Time: 3:35p
 * Updated in $/PJ
 * Standardized History and include format.
 * Implemented Insert Template Wizard.
 * 
 * *****************  Version 2  *****************
 * User: Navis        Date: 4/19/99    Time: 3:29p
 * Updated in $/PJ
 * class to obtain module version info.  Intend to use in About Dialog
 * box.
*/
//////////////////////////////////////////////////////////////////////
// by Manuel Laflamme from CodeGuru site.

class CFileVersion
{ 
// Construction
public: 
    CFileVersion();

// Operations	
public: 
    BOOL    Open(LPCTSTR lpszModuleName);
    void    Close();

    CString QueryValue(LPCTSTR lpszValueName, DWORD dwLangCharset = 0);
    CString GetFileDescription()  {return QueryValue(_T("FileDescription")); };
    CString GetFileVersion()      {return QueryValue(_T("FileVersion"));     };
    CString GetInternalName()     {return QueryValue(_T("InternalName"));    };
    CString GetCompanyName()      {return QueryValue(_T("CompanyName"));     }; 
    CString GetLegalCopyright()   {return QueryValue(_T("LegalCopyright"));  };
    CString GetOriginalFilename() {return QueryValue(_T("OriginalFilename"));};
    CString GetProductName()      {return QueryValue(_T("ProductName"));     };
    CString GetProductVersion()   {return QueryValue(_T("ProductVersion"));  };

    BOOL    GetFixedInfo(VS_FIXEDFILEINFO& vsffi);
    CString GetFixedFileVersion();
    CString GetFixedProductVersion();

// Attributes
protected:
    LPBYTE  m_lpVersionData; 
    DWORD   m_dwLangCharset; 

// Implementation
public:
    ~CFileVersion(); 
}; 




By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions