CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Posts
    230

    can i get compilation version to promote by one and use in code in c++

    i have meany compilations that each time i done compilation i move it to dyploy dir also i have debug and release versions , im getting lost here . my question is is there any way to promote some global variable by 1 each time im done compiling , maybe also getting the compilation type (debug oe release ) then i like to use this string in code: im using visual studio express 2008

    something like :
    Code:
    std::string ver = VISUAL_STUDIO_MACRO_VERSIONING
    if(ver > prev_ver)
    {
     ..do something .. 
     like print to log
    }

  2. #2
    Join Date
    Dec 2010
    Posts
    20

    Re: can i get compilation version to promote by one and use in code in c++

    you can use _MFC_VER and _DEBUG

    examples:

    #if _MSC_VER < 1202
    //EVC 4.0 complier is cross 1200 - 1202
    #else if _MSC_VER >= 1400
    //Visual C++ 2005 complier is 1400
    #else
    //Visual C++ 2005 complier is 1400
    #endif
    ///////////////////////////////////////

    #ifdef _DEBUG
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif

  3. #3
    Join Date
    Aug 2006
    Posts
    230

    Re: can i get compilation version to promote by one and use in code in c++

    Thanks , but i dont understand how can i automatically promote it by one each compilation
    how it can remember the last number , file ?

  4. #4
    Join Date
    Dec 2010
    Posts
    20

    Re: can i get compilation version to promote by one and use in code in c++

    if you are using Vc++, this may help you.
    http://support.microsoft.com/default...b;en-us;237870

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