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. updateresource question

updateresource question

Scheduled Pinned Locked Moved C / C++ / MFC
announcementc++questiondiscussionlearning
5 Posts 4 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.
  • D Offline
    D Offline
    drkar
    wrote on last edited by
    #1

    hi, I am trying to programatically update the version information in a dllI am using Beginupdateresouce updateresource Endupdateresource. The functions always suceed but the resource is not updated. Is there any program or code which is available in the net to do this. any thoughts will be greately appreciated. I am running the program on NT. thanks karthik ps: I am running the program on NT I know that if we have the source we can edit version info in VC++,but I dont want to do it that way

    P D B 3 Replies Last reply
    0
    • D drkar

      hi, I am trying to programatically update the version information in a dllI am using Beginupdateresouce updateresource Endupdateresource. The functions always suceed but the resource is not updated. Is there any program or code which is available in the net to do this. any thoughts will be greately appreciated. I am running the program on NT. thanks karthik ps: I am running the program on NT I know that if we have the source we can edit version info in VC++,but I dont want to do it that way

      P Offline
      P Offline
      Paolo Messina
      wrote on last edited by
      #2

      If you may do it manually, try one tool from this address http://www.blubb.at/sweety/toolz/resource.htm

      1 Reply Last reply
      0
      • D drkar

        hi, I am trying to programatically update the version information in a dllI am using Beginupdateresouce updateresource Endupdateresource. The functions always suceed but the resource is not updated. Is there any program or code which is available in the net to do this. any thoughts will be greately appreciated. I am running the program on NT. thanks karthik ps: I am running the program on NT I know that if we have the source we can edit version info in VC++,but I dont want to do it that way

        D Offline
        D Offline
        Dmitriy
        wrote on last edited by
        #3

        Well, I was unable to update resource also. I've just got the same second resource with the ID like I've wanted to update, but it appeares like I had 2 resources instead of 1 updated.

        B 1 Reply Last reply
        0
        • D drkar

          hi, I am trying to programatically update the version information in a dllI am using Beginupdateresouce updateresource Endupdateresource. The functions always suceed but the resource is not updated. Is there any program or code which is available in the net to do this. any thoughts will be greately appreciated. I am running the program on NT. thanks karthik ps: I am running the program on NT I know that if we have the source we can edit version info in VC++,but I dont want to do it that way

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

          I figured it out! You MUST free the library prior to using the BeginUpdateResource, UpdateResource, EndUpdateResource sequence. Even though update always truly failed when library was loaded in memory, no errors were indicated or returned! Here is pseudo-code sequence... LoadLibraryEx <- no need to execute dll entry point FindResourceEx LoadResource LockResource <- gets pointer to data SizeofResource <- how much data you got ...allocate memory to hold modifiable copy of resource data ...make copy of resource data into memory block FreeLibrary <- important to do it here BeginUpdateResource ...modify resource data, or supply new data if you want UpdateResource EndUpdateResource ...deallocate memory you obtained earlier That's it! As a test, I was able to modify the fixed file version information (dwFileVersionMS and dwFileVersionLS fields in the VS_FIXEDFILEINFO) and see that the changes had occurred.

          1 Reply Last reply
          0
          • D Dmitriy

            Well, I was unable to update resource also. I've just got the same second resource with the ID like I've wanted to update, but it appeares like I had 2 resources instead of 1 updated.

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

            This happened to me also. However, I tracked it down to not setting the locale correctly when I saved the resource back to the file. You can load the resource specifying a generic language identifier... "If this parameter is MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), the current language associated with the calling thread is used." When you go to save it, however, the language ID better match what was in the file in the first place or else you will end up with another resource stuffed into the file with a different language identification associated with it! The resources in my file are tagged with the following: LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

            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