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. HowTo read/display version info

HowTo read/display version info

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++visual-studioannouncement
4 Posts 3 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.
  • R Offline
    R Offline
    Robert Palma Jr
    wrote on last edited by
    #1

    Using Visual Studio 6.0, C/C++ === Question 1 I am using the Workspace | ResourceView | Version to input my current version info. How do I read that info from within my code, so that I can display it to the User on their demand? === Question 2 I am writing a Dialog-Based program. Is there any way to show the User the About Box? Many thanks, Robert :)

    D 1 Reply Last reply
    0
    • R Robert Palma Jr

      Using Visual Studio 6.0, C/C++ === Question 1 I am using the Workspace | ResourceView | Version to input my current version info. How do I read that info from within my code, so that I can display it to the User on their demand? === Question 2 I am writing a Dialog-Based program. Is there any way to show the User the About Box? Many thanks, Robert :)

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Check out VerQueryValue() and GetFileVersionInfo(). Robert Palma Jr. wrote: I am writing a Dialog-Based program. Is there any way to show the User the About Box? Yes. If you used AppWizard, it was one of the choices.


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      R 1 Reply Last reply
      0
      • D David Crow

        Check out VerQueryValue() and GetFileVersionInfo(). Robert Palma Jr. wrote: I am writing a Dialog-Based program. Is there any way to show the User the About Box? Yes. If you used AppWizard, it was one of the choices.


        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

        R Offline
        R Offline
        Robert Palma Jr
        wrote on last edited by
        #3

        Thank-you David, I am working on it. Sounds like I have to read the version info FROM the file on the HD, rather than being able to read it from the image that is currently in memory. Thanks again, Robert

        B 1 Reply Last reply
        0
        • R Robert Palma Jr

          Thank-you David, I am working on it. Sounds like I have to read the version info FROM the file on the HD, rather than being able to read it from the image that is currently in memory. Thanks again, Robert

          B Offline
          B Offline
          Blake Miller
          wrote on last edited by
          #4

          I am not sure about your statement. If you have the module handle (an image in memory), I think you can load the version resource from that as well, meaning you CAN get the version information from an image in memory. I have not done this before, but this is what I would try to do: For an image in memory, you can try FindResource -> LoadResource -> LockResource -> Use pointer in call to VerQueryValue -> FreeResource. I think you can use SizeofResource if you need total size of resource information (in lieu of GetFileVersionInfoSize). You are using FindResource, LoadResource, and LockResource instead of GetFileVersionInfo. FreeResource is called when you are done so that the memory is freed.

          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