Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Build no.
Hi,
Anoby know how to get an automatic build no. when building an executable
in CVF 6.6C (and/or IVF8.1).
Want to refer to it in a help dialog. I use Winteracter to build the
gui.

Regards,
Dan Holm
--
Alfgam optimering AB
url:   http://www.alfgam.se



Report this thread to moderator Post Follow-up to this message
Old Post
Dan Holm
11-17-04 01:57 PM


Re: Build no.
Dan Holm wrote:
| Hi,
| Anoby know how to get an automatic build no. when building an executable
| in CVF 6.6C (and/or IVF8.1).
| Want to refer to it in a help dialog. I use Winteracter to build the
| gui.

I use a "IncResVersion" macro. It increments the build number of the
"Version" resource in your .rc file and builds the application every
time you run it. This is the modified version of a macro I found
here:

http://www.codeguru.com/Cpp/V-S/devstudio_macros/

So:

1) Go to Tools/Macro/Edit and paste the code below into the
MyMacro.dsm code
2) Go to Tools/Customize and add the macro to "Build" menu
and/or assign a key combination to it (I keep both "Build"
and "IncResVersion" menu items in cases I don't have/don't
want the update of version resource)
3) Add a "Version" resource to your resource (if you don't have
one)
4) The .rc file must be opened in order for the macro to run
successfully.

The version information can be viewed from Explorer->Properties->
Version tab. If you want to retrieve it programmatically, see here:

http://softwareforums.intel.com/ids...message.id=4032

HTH,
--
Jugoslav
___________
www.geocities.com/jdujic

Please reply to the newsgroup.
You can find my real e-mail on my home page above.

'---------------------------------------
Sub IncResVersion()
'DESCRIPTION: Build active project and increase version counters in rc scrip
t.
'(c)'98 Th. Mahler and parts by LJP. Modified by N.E. Powroz -- Dec 1999
'Modified by Peter Smolders   03 Jan 2000
'Modified by Jugoslav Dujic  2002

Dim strMonth
Dim strDay
Dim strYear
Dim strHour
Dim strMinute
Dim strSecond

Dim Wnd
Dim strOldFileVersion
Dim strNewFileVersion
Dim strOldProductVersion
Dim strNewProductVersion
Dim strSelection
Dim strTemp

Dim documentObject
Dim bFound

' open the project's resource script:

bResult = MsgBox( "Increase Build Number?", vbYesNo )
if bResult=vbYes then

strTemp = ActiveProject.FullName

bFound = False
For Each documentObject in Application.Documents
Wnd = Right(documentObject.FullName,2)
if (Wnd = "rc") then
Wnd = documentObject.FullName
bFound = True
exit for
end if
Next

If (Not bFound) then
MsgBox "Please open .rc file."
Else
' SAVE BACK-UP OF FILE >>>>
Documents.Open (Wnd)
documentObject.Active = True
'  ActiveDocument.Save (Wnd+"~")

ActiveDocument.Close()
Documents.Open Wnd, "Text"

'Go to 2nd line in rc file, delete it, and get current time/date
ActiveDocument.Selection.GoToLine 2
ActiveDocument.Selection.SelectLine
ActiveDocument.Selection.Delete

strMonth = CStr(DatePart("m", Now))
strDay = CStr(DatePart("d", Now))
strYear = CStr(DatePart("yyyy", Now))
strHour = CStr(DatePart("h", Now))
strMinute = CStr(DatePart("n", Now))
strSecond = CStr(DatePart("s", Now))

'write current date/time and add newline - formatted for USA
ActiveDocument.Selection.Text ="// Last compiled "+strDay +
"."+strMonth+"."+strYear+" at "+strHour+":"+strMinute+":"+strSecond    + vbC
rLf

' find line with FileVersion Information:
ActiveDocument.Selection.FindText "FILEVERSION", dsMatchForward +
dsMatchFromStart + dsMatchCase + dsMatchWord

' move to eol and then to end of build number:
ActiveDocument.Selection.EndOfLine

' mark Build Number and store in strSelection
ActiveDocument.Selection.WordLeft dsExtend, 1

Set strSelection = ActiveDocument.Selection
strOldFileVersion = strSelection.Text
strNewFileVersion = strOldFileVersion + 1

' Replace file entry
strSelection.Text = strNewFileVersion

' info block
ActiveDocument.Selection.FindText "VALUE ""FileVersion"",",
dsMatchForward + dsMatchFromStart + dsMatchCase

' move to eol and then to end of build number:
ActiveDocument.Selection.EndOfLine
ActiveDocument.Selection.CharLeft dsMove, 3

' mark Build Number and store in strVersion
ActiveDocument.Selection.WordLeft dsExtend, 1

Set strSelection = ActiveDocument.Selection
strSelection.Text = strNewFileVersion

ActiveDocument.Save()
End If
End If
ExecuteCommand "Build"
'  ActiveDocument.Close()

End Sub


Report this thread to moderator Post Follow-up to this message
Old Post
Jugoslav Dujic
11-17-04 01:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:57 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.