Click here to Skip to main content
15,897,891 members
Articles / Desktop Programming / ATL

Increment File and Product Version Number - Multiple IDE

Rate me:
Please Sign up or sign in to vote.
4.58/5 (32 votes)
21 Oct 2008CPOL12 min read 294.6K   1.2K   134  
An add-in to automatically increment the FileVersion and ProductVersion fields in your application's resource file. Works in VC6 and VS2005, and probably all versions in between.
/**
 * \file ConfigDlg.cpp
 *
 * \brief Implementation file for class CConfigDlg
 *
 * $Id: ConfigDlg.cpp, v1.1.1.1 2006/09/24 23:12:29 mgh Exp $
 *
 *
 * Copyright (C) 2006 Michael G. Herstine <sp1ff@pobox.com>
 *
 * Permission to use, copy, or modify this source code is hereby granted
 * free of charge, provided that this copyright notice appear on all
 * copies and on all source code derived from this code.  No
 * representation is made regarding the suitability of this software for
 * any purpose.  It is provided "as is" without express or implied
 * warranty.
 *
 *
 */

////////////////////////////////////////////////////////////////////////////
// Modified by Jordan Walters, 01.03.2008 for multi-IDE version increment //
////////////////////////////////////////////////////////////////////////////

#include "StdAfx.h"             // Pre-compiled header
#include "AddIn.h"              // Project header
#include "ConfigDlg.h"          // For class CConfigDlg

////////////////////////////////////////////////////////////////////////

CConfigDlg::CConfigDlg()
{
	m_dwDigit = DEF_DIGIT;
	m_bResetLowerVersions = DEF_RESET;
	m_bRevertToBuildNumber = DEF_REVERT;
	m_bDisplayWarnings = DEF_DISPLAY_WARNINGS;
}

CConfigDlg::~CConfigDlg()
{
}

LRESULT CConfigDlg::OnInitDialog(UINT /*nMsg*/,
								 WPARAM wParam,
								 LPARAM lParam,
								 BOOL &bHandled)
{
	CDlgMixin<CConfigDlg>::OnInitDialog(wParam, lParam, bHandled);

	return 1L;                    // Let the system set the focus
}

LRESULT CConfigDlg::OnClickedOK(WORD /*wNotifyCode*/,
								WORD wID,
								HWND /*hWndCtl*/,
								BOOL& /*bHandled*/)
{
	CDlgMixin<CConfigDlg>::OnClickedOK();
	setOptionsToReg(m_dwDigit, m_bResetLowerVersions, m_bRevertToBuildNumber, m_bDisplayWarnings);
	EndDialog(wID);
	return 0L;
}

LRESULT CConfigDlg::OnClickedCancel(WORD /*wNotifyCode*/,
									WORD wID,
									HWND /*hWndCtl*/,
									BOOL& /*bHandled*/)
{
	EndDialog(wID);
	return 0L;
}

LRESULT CConfigDlg::OnClickedVersion(WORD /*wNotifyCode*/,
									 WORD /*wID*/,
									 HWND /*hWndCtl*/,
									 BOOL& /*bHandled*/)
{
	return CDlgMixin<CConfigDlg>::OnClickedVersion();
}

LRESULT CConfigDlg::OnClickedStatusMajorVersion(WORD /*wNotifyCode*/,
												WORD /*wID*/,
												HWND /*hWndCtl*/,
												BOOL& /*bHandled*/)
{
	return CDlgMixin<CConfigDlg>::OnClickedStatusMajorVersion();
}

LRESULT CConfigDlg::OnClickedStatusMinorVersion(WORD /*wNotifyCode*/,
												WORD /*wID*/,
												HWND /*hWndCtl*/,
												BOOL& /*bHandled*/)
{
	return CDlgMixin<CConfigDlg>::OnClickedStatusMinorVersion();
}

LRESULT CConfigDlg::OnClickedStatusRevision(WORD /*wNotifyCode*/,
											WORD /*wID*/,
											HWND /*hWndCtl*/,
											BOOL& /*bHandled*/)
{
	return CDlgMixin<CConfigDlg>::OnClickedStatusRevision();
}

LRESULT CConfigDlg::OnClickedStatusBuildNumber(WORD /*wNotifyCode*/,
											   WORD /*wID*/,
											   HWND /*hWndCtl*/,
											   BOOL& /*bHandled*/)
{
	return CDlgMixin<CConfigDlg>::OnClickedStatusBuildNumber();
}

// Local Variables:
// fill-column: 72
// indent-tabs-mode: nil
// show-trailing-whitespace: t
// End:

// ConfigDlg.cpp ends here.

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
Ok, it's about time I updated this profile. I still live near 'Beastly' Eastleigh in Hampshire, England. However I have recently been granted a permamant migration visa to Australia - so if you're a potential employer from down under and like the look of me, please get in touch.
Still married - just, still with just a son and daughter. But they are now 8 and 7 resp and when together they have the energy of a nuclear bomb.
I worked at Teleca UK for over 8.5 years (but have now moved to TikitTFB) and have done loads of different things. Heavily involved with MFC, SQL, C#, The latest is ASP.NET with C# and Javascript. Moving away from Trolltech Qt3 and 4.
Jordan.

Comments and Discussions