Tuesday, September 21, 2004
Autoincrementing the Build Numbers in VC++
The option to automatically increment the build numbers (for successful builds) is one thing VC++ misses. AFAIK, VB & Borland C++/Delphi users have long had this ability.
http://www.codeguru.com/Cpp/V-S/devstudio_macros/versioncontrol/article.php/c3129
This solution makes use of Application_BeforeBuildStart() handler to increment the RC VERSIONINFO. The Build # is incremented even for failed builds.
http://www.codeproject.com/cpp/rcversion.asp
Not exactly an auto-increment solution. This allows you to enter the version info during the build process.
http://www.codeguru.com/Cpp/V-S/devstudio_macros/article.php/c3183
Another solution posted in CodeGuru. It is assignable to any key and when invoked it updates the RC "FileVersion" field and does "BuildToggleBuild". :)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q237870
Solution posted by MS. The autoincrementing code is attached to Application_BuildFinish(). It updates a #define in versionno.h which is included by the user resource file (RC2) .
http://www.flipcode.com/cgi-bin/msg.cgi?showThread=Tip-AutomaticBuildVersion&forum=totd&id=-1
I haven't tried this. But, the author claims to combine the best of MS & Codeguru (second one) solutions.
I used a modified version of the solution from MS (mine didn't update the RC; instead it updated a H file that was included across the project). If there is a neat/effective solution for this, let me know.
|