Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. VERSIONINFO in program

VERSIONINFO in program

Scheduled Pinned Locked Moved C / C++ / MFC
announcementvisual-studioquestionlearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shultas
    wrote on last edited by
    #1

    Hey all. I noticed the VS_VERSION_INFO resource that is inside my program that I am building. I am building code that displays the current version in various places. I would like to be able to pull the values from this VS_VERSION_INFO resource, instead of having to declare a version-info variable in my class -- which just makes more places for me to update it. I checked MSDN about this and all that I can come up with is GetFileVersionInfo() method. I do not want to have to use a method if I don't have to that acutally looks at its own .EXE to determine the current version. I am wondering if there is another method or some other way to grab those values from the resource at compile time? Thanks!

    P 1 Reply Last reply
    0
    • S shultas

      Hey all. I noticed the VS_VERSION_INFO resource that is inside my program that I am building. I am building code that displays the current version in various places. I would like to be able to pull the values from this VS_VERSION_INFO resource, instead of having to declare a version-info variable in my class -- which just makes more places for me to update it. I checked MSDN about this and all that I can come up with is GetFileVersionInfo() method. I do not want to have to use a method if I don't have to that acutally looks at its own .EXE to determine the current version. I am wondering if there is another method or some other way to grab those values from the resource at compile time? Thanks!

      P Offline
      P Offline
      pranavamhari
      wrote on last edited by
      #2

      Hi, Search google for a class 'CModuleVersion' which can be used as TCHAR szPath[MAX_PATH]; GetModuleFileName(NULL,szPath,MAX_PATH); CModuleVersion ver; if(ver.GetFileVersionInfo( szPath , TRUE)){ CString s; s.Format(IDS_STRING61504,HIWORD(ver.dwFileVersionMS), LOWORD(ver.dwFileVersionMS), HIWORD(ver.dwFileVersionLS)); SetDlgItemText(IDC_VERSION , s );//UnicodeConversion } Hari Krishnan

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups