BuildCount Add-In
Posted
by Eldad Kuperman
on January 5th, 2000
For example, if your project is on build 6, the contents of the file look like this:
// 6
#ifndef AUTOBUILDCOUNT_H
#define AUTOBUILDCOUNT_H
#define BUILDCOUNT_NUM 6
#define BUILDCOUNT_STR "6"
#endif
At the next build, the content will be updated to:
// 7 #ifndef AUTOBUILDCOUNT_H #define AUTOBUILDCOUNT_H #define BUILDCOUNT_NUM 7 #define BUILDCOUNT_STR "7" #endif
You can use the macros BUILDCOUNT_NUM and/or BUILDCOUNT_STR in the code to refer to the automatically generated build number. For example, to use the build number in your about box, you could use the macro as follows:
#include "AutoBuildCount.h"
//...
CAboutDlg::CAboutDlg()
{
m_strBuild.Format(_T("Build %d"), BFCBUILDCOUNT_NUM);
}
Installation:
- Copy the file BuildCount.dll to a local folder (DevStudio\SharedIDE\AddIns if the preferred folder).
- At the Developer Studio, choose Customize from the Tools menu.
- Select Browse from the Add-ins and Macro Files page.
- Select 'Add-ins (.dll)' from the 'Files of type' combo-box.
- Select the BuildCount.dll from its folder and click on Open.
Recent Updates/Fixes
1. MSDEV has a failure when exiting.2. GPF when the file AutoBuildCount.h is read-only.

Comments
how to stop file modified out of source editor ?
Posted by Legacy on 10/18/2000 12:00amOriginally posted by: lee
how do i stop it showing this message every time i recompile, because the autobuildcount.h has been updated ?
thanks
Replylee.
source please
Posted by Legacy on 05/25/2000 12:00amOriginally posted by: Mike McCanney
Where can I get the source for this?
ReplyInaccurate build number using more than one project in one workspace
Posted by Legacy on 04/18/2000 12:00amOriginally posted by: J�rg Schlingmann
Hi there,
I' m using a workspace containing more than 120 projects.
If I compile only one project everything works fine. (I accept the buildcount increasing 2)
Rebuilding the whole workspace causes increasing the buildcount number of the currently active project
> 120 times not increasing any other buildcount number.
Does anyone know a workaround? (VC++ 5.0 Servicepack 3, NT4 Servicepack 5)
J�rg
ReplyIncrement only for release builds
Posted by Legacy on 01/19/2000 12:00amOriginally posted by: Gene Koesling
ReplyNice, but big feature needed...
Posted by Legacy on 09/10/1999 12:00amOriginally posted by: Thelonious Georgia
Hi, as DevStudio knows when a build did not complete due to an error, it would be nice if somehow the build number could 'unwind', as it wasn't really a build in the first place.
ReplySource Again
Posted by Legacy on 08/02/1999 12:00amOriginally posted by: Paul Hartness
Having the source for this would be good. I'd like to have a version of this that would only increment for release builds also some method of synchronising these numbers in a multi-user environment. Maybe by having a global network location for AutoBuildCount.h which had counts for different projects.
ReplyUnicode/MBCS Support + Release/Debug
Posted by Legacy on 07/29/1999 12:00amOriginally posted by: Victor Boctor
I think this is a very nice add-on. The only comments I have are:
1. The header file should have two counters one for the release and one for the debug. The one that is to be incremented should depend on the current configuration. However, the current constants should map to one of them according to the definition of the _DEBUG preprocessor. By this we will have a separate counter for the debug and another for the release.
2. For the string, I think the macro _T should be used so that the compilation would work ok with normal, unicode, and MBCS.
Thanks!
ReplyGreat Job! .. Feature Request
Posted by Legacy on 06/16/1999 12:00amOriginally posted by: David Berman
Thank you very much for making this add-in. You did
a great job.
It seems that the file AutoBuildCount.h must be in
the same directory as the project file. It would
be nice if we could put that file wherever we wanted
to and add it to the project. If the plugin scans
the project and found the specified location of
this header, it should use that file instead of
creating a new one.
Thanks again.
David
Reply