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. text string ID to numeric ID

text string ID to numeric ID

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

    I am receiving some configuration setting via a XML document. One of the entry is the caption of a column header. The caption is given using a string ID (IDS_COL1_CAPTION) when extracting this info from the XML document the resulting value is a string containing “IDS_COL1_CAPTION”. Is there a way to convert this text string ID into a numeric ID to be able to use the LoadString function of CString? Thank you

    C T 2 Replies Last reply
    0
    • S Sascha

      I am receiving some configuration setting via a XML document. One of the entry is the caption of a column header. The caption is given using a string ID (IDS_COL1_CAPTION) when extracting this info from the XML document the resulting value is a string containing “IDS_COL1_CAPTION”. Is there a way to convert this text string ID into a numeric ID to be able to use the LoadString function of CString? Thank you

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      nope. there's no automatic way to do it. you'll have to set up a mapping of strings to numerics. i would use a std::map. -c


      Democracy is the worst form of government except all those other forms that have been tried from time to time. -- Winston Churchill

      image effects!

      1 Reply Last reply
      0
      • S Sascha

        I am receiving some configuration setting via a XML document. One of the entry is the caption of a column header. The caption is given using a string ID (IDS_COL1_CAPTION) when extracting this info from the XML document the resulting value is a string containing “IDS_COL1_CAPTION”. Is there a way to convert this text string ID into a numeric ID to be able to use the LoadString function of CString? Thank you

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        I don't think so - if IDS_COL1_CAPTION is resource identifier. When you build exe/dll, the #defines are expanded to constant integers, there's no 'IDS_COL1_CAPTION' literal in executable. You'd have to provide your own mapping from strings to integers. Tomasz Sowinski -- http://www.shooltz.com

        ** Putt knot yore thrust inn spel chequers. **

        S 1 Reply Last reply
        0
        • T Tomasz Sowinski

          I don't think so - if IDS_COL1_CAPTION is resource identifier. When you build exe/dll, the #defines are expanded to constant integers, there's no 'IDS_COL1_CAPTION' literal in executable. You'd have to provide your own mapping from strings to integers. Tomasz Sowinski -- http://www.shooltz.com

          ** Putt knot yore thrust inn spel chequers. **

          S Offline
          S Offline
          Sascha
          wrote on last edited by
          #4

          Thank you. This is what I was also thinking.

          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