Click here to Skip to main content
15,885,278 members
Articles / Desktop Programming / MFC
Article

Increment Private Build Number

Rate me:
Please Sign up or sign in to vote.
3.00/5 (2 votes)
8 Feb 2000 81.8K   1K   24   8
An add-in to automatically increment the PrivateBuild field in your applications resource file.
  • Download source files - 34 Kb
  • Many times you have to distinguish between two executable versions of the same file, and not only by version number. As all know, the version descriptor from the resource file contains a lot of fields: CompanyName, FileDescription, Files Version, and so on. Following these fields is the SpecialBuild field. I made this Add-In to increments this number. I found it very useful, the sources are free, and you can easy improve it to personalize one (or more) of the version resource descriptors.

    The Add-In has to be activated from the Add-In Manager in Developer Studio.

    How does this work? When you are in the current project, and call the Build (Rebuild) commands the Add-In increments the number found on SpecialBuild and saves it.

    It is not a big stuff but is still useful.

    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
    Software Developer Exontrol
    Romania Romania
    This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

    Comments and Discussions

     
    GeneralNewer version Pin
    Jordan Walters29-Nov-04 22:01
    Jordan Walters29-Nov-04 22:01 
    GeneralRe: Newer version Pin
    Mihai Filimon30-Nov-04 1:53
    Mihai Filimon30-Nov-04 1:53 
    GeneralNew Version Pin
    Jordan Walters14-Oct-04 10:42
    Jordan Walters14-Oct-04 10:42 
    GeneralBatch Build or Dependencies Pin
    19-Nov-01 11:13
    suss19-Nov-01 11:13 
    GeneralAn other small bug Pin
    Gerolf Reinwardt10-Jul-01 0:31
    Gerolf Reinwardt10-Jul-01 0:31 
    GeneralIncrement Private Build Number Pin
    18-Jan-01 1:57
    suss18-Jan-01 1:57 
    GeneralSuggestion Pin
    Brian V. Shifrin16-Feb-00 1:10
    sussBrian V. Shifrin16-Feb-00 1:10 
    GeneralSmall Bug found.... Pin
    James Curran10-Feb-00 6:09
    James Curran10-Feb-00 6:09 
    The add-in, as written, will always update the first project in a workspace. If you only ever use one project per workspace, this is not a problem.
    However, if you sometimes put multiple project into a single workspace, you'll need to make the following changes:

    in CCommands::IncPrivateBuildCommandMethod(), replace the lines:
    IProjects* pProjects = NULL;
    IGenericProject* pProject = NULL;

    if ( SUCCEEDED( GetApplicationObject()->get_Projects( (LPDISPATCH*)&pProjects ) ) )
    {
    if ( SUCCEEDED( pProjects->Item( COleVariant( (long)1 ), &pProject ) ) )
    {

    with the lines:
    IGenericProject* pProject = NULL;
    if ( SUCCEEDED( GetApplicationObject()->get_ActiveProject( (LPDISPATCH*)&pProject ) ) )
    {

    at the bottom of that function, remove the lines:
    }
    pProjects->Release();

    (you may also wish to readjust the indenting.

    Further, to build a DEBUG compiler, you will need to make the following change:
    In CCommands::UpdateResource, change:
    #ifdef _DEBUG
    afxDump << "Resource file " << strProjectName << " couldn't be saved " << e->m_cause << "\n";
    #endif

    with
    #ifdef _DEBUG
    afxDump << "Resource file " << m_strResourceName << " couldn't be saved " << e->m_cause << "\n";
    #endif


    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.