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. Can't load string from resource DLL's string table

Can't load string from resource DLL's string table

Scheduled Pinned Locked Moved C / C++ / MFC
learninghelpquestionworkspace
5 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
    s_k
    wrote on last edited by
    #1

    Hi, I use resource DLLs to provide multilingual environment to users - user select language, I call AfxSetResourceHandle() with handle of relevant DLL and in all functions that load some kind of resource, I use AfxGetResourceHandle(). It works great (I have six resource DLLs now + base project, which is in english). Of course I use same resource symbols in resource.h, with the same values. But sometimes happens that I'm not able to load certain string from string table of one of DLLs. It has the same value assigned in resource.h as in all others DLLs but it just doesn't work. The only thing that helps that I must add new string to all DLLs and change the code to use this symbol instead of the old one. I really don't understand what the problem is What could be the reason? Have you ever met some similar problem?

    M 1 Reply Last reply
    0
    • S s_k

      Hi, I use resource DLLs to provide multilingual environment to users - user select language, I call AfxSetResourceHandle() with handle of relevant DLL and in all functions that load some kind of resource, I use AfxGetResourceHandle(). It works great (I have six resource DLLs now + base project, which is in english). Of course I use same resource symbols in resource.h, with the same values. But sometimes happens that I'm not able to load certain string from string table of one of DLLs. It has the same value assigned in resource.h as in all others DLLs but it just doesn't work. The only thing that helps that I must add new string to all DLLs and change the code to use this symbol instead of the old one. I really don't understand what the problem is What could be the reason? Have you ever met some similar problem?

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      To prevent the whole world being rebuilt whenever a resource file changes, Visual C++ ignores changes to the resource.h header file. You may find that a Rebuild All corrects this problem.

      S 1 Reply Last reply
      0
      • M Mike Dimmick

        To prevent the whole world being rebuilt whenever a resource file changes, Visual C++ ignores changes to the resource.h header file. You may find that a Rebuild All corrects this problem.

        S Offline
        S Offline
        s_k
        wrote on last edited by
        #3

        Rebuilding all didn't help..:-(

        M 1 Reply Last reply
        0
        • S s_k

          Rebuilding all didn't help..:-(

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          Are all your resource files using the same resource.h file for their resource numbers, or are you adding new resources individually to each one? I'm not sure how well Visual C++ copes with multiple resource files - it seems to think that a resource header will only be associated with a single resource file, which I noticed when trying to rename a resource file... It might be better to define your resource numbers in your own header file; in the IDE, select View > Resource Includes, then add your own resource number file as a #include in the Read-only symbol directives box. You'll have to declare the IDs manually rather than using the resource editor. You can use the resource editor once you've declared them.

          S 1 Reply Last reply
          0
          • M Mike Dimmick

            Are all your resource files using the same resource.h file for their resource numbers, or are you adding new resources individually to each one? I'm not sure how well Visual C++ copes with multiple resource files - it seems to think that a resource header will only be associated with a single resource file, which I noticed when trying to rename a resource file... It might be better to define your resource numbers in your own header file; in the IDE, select View > Resource Includes, then add your own resource number file as a #include in the Read-only symbol directives box. You'll have to declare the IDs manually rather than using the resource editor. You can use the resource editor once you've declared them.

            S Offline
            S Offline
            s_k
            wrote on last edited by
            #5

            All DLLs have their own resource.h file (but with the same content). So when I need add new resource, I just add the resource in MSVC++ Resource Editor and it does everything for me. It's just confusing for me that all six DLLs are working well exceptiong the only one...

            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