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. Resource Id

Resource Id

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
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.
  • S Offline
    S Offline
    Spiros
    wrote on last edited by
    #1

    How can I retrieve the resource of a entry in the string table. That is knowing the name, "IDS_STRING1" to retrieve the int value and thus to be able to retrieve the caption of the specific entry. Spiros Prantalos

    P 1 Reply Last reply
    0
    • S Spiros

      How can I retrieve the resource of a entry in the string table. That is knowing the name, "IDS_STRING1" to retrieve the int value and thus to be able to retrieve the caption of the specific entry. Spiros Prantalos

      P Offline
      P Offline
      Pavel Klocek
      wrote on last edited by
      #2

      LoadString API function or CString::LoadString method if using MFC. Pavel Sonork 100.15206

      S 1 Reply Last reply
      0
      • P Pavel Klocek

        LoadString API function or CString::LoadString method if using MFC. Pavel Sonork 100.15206

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

        Using that I have to provide the IDS_STRING1 which actually is the int value. What I am saying is to have the name on a string that is CString hhh = "IDS_STRING1" and with that to be able to find the caption of that the entry that has the same name in the string table Spiros Prantalos

        M 1 Reply Last reply
        0
        • S Spiros

          Using that I have to provide the IDS_STRING1 which actually is the int value. What I am saying is to have the name on a string that is CString hhh = "IDS_STRING1" and with that to be able to find the caption of that the entry that has the same name in the string table Spiros Prantalos

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          You can't do that directly. The compiler never sees "IDS_STRING1", only the number that it is #defined as. You'll need to create a lookup table (using std::map for example) to convert from the string to the numerical equivalent. --Mike-- "alyson hannigan is so cute it's crazy" -- Googlism Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

          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