CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: learn to count

  1. #1
    Join Date
    Aug 1999
    Posts
    281

    learn to count

    Goodmeurning!

    Does anybody know if MSVC++ 6.0 counts the number of times that you have built your project? I'd like to mention this number in the about-dialog. (Yes, I got the idea from Napster... I know!)

    TIA,

    Jan

    I ask this because I would like to know when I should replace my F7-key ;-)
    According to the manual of my keyboard it can take 50000 presses...


  2. #2
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443

    Re: learn to count

    I have a macro associated w/ a toolbar button in MSDEV. The macro looks like:

    Sub VersionedBuild()
    Dim s
    Documents.Open "version.h", "Text"
    ActiveDocument.Selection.StartOfLine
    ActiveDocument.Selection.WordRight dsMove, 3
    ActiveDocument.Selection.WordRight dsExtend
    s = cint(ActiveDocument.Selection)
    s = s + 1
    ActiveDocument.Selection = cstr(s)
    ActiveDocument.Save
    ActiveDocument.Close
    Application.Build
    End Sub




    And version.h looks like:

    #define XVERSION 2097



    and is included in stdafx.h. I use XVERSION to display the build No.

    Gabriel.
    _
    Forever trusting who we are
    And nothing else matters
    - Metallica
    _
    Gabriel, CodeGuru moderator

    Forever trusting who we are
    And nothing else matters
    - Metallica

    Learn about the advantages of std::vector.

  3. #3
    Join Date
    Aug 1999
    Posts
    281

    Re: learn to count

    Ok, thanks for your macro!

    As I've never used them before I don't know how to create one... Could you please explain?

    regards,

    jan


  4. #4
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443

    Re: learn to count

    Macro files are placed in ...\Microsoft Visual Studio\Common\MSDev98\Macros, and have the extension .dsm. Create a new text file, call it mymacros.dsm and copy the macro there.

    Then menu Tools->Customize->Add-ind and MacroFiles, check Mymacros.

    Then menu Tools->Customize->Commands, category "Macros", drag the macro to the toolbar where you want it. A dialog pops up and you can assigh a button face to the macro.

    Voila.

    Gabriel.
    _
    Forever trusting who we are
    And nothing else matters
    - Metallica
    _
    Gabriel, CodeGuru moderator

    Forever trusting who we are
    And nothing else matters
    - Metallica

    Learn about the advantages of std::vector.

  5. #5
    Join Date
    Aug 1999
    Posts
    281

    Re: learn to count

    Unbelievable...
    Really amazing!


    You should write an article on this topic here on CodeGuru!

    many thanks


    Jan



  6. #6
    Join Date
    Apr 2005
    Posts
    42

    Question Re: learn to count

    How can we read build no. while building a.net application, is the procedure same as described above?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured