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. parser

parser

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

    I have an INI file that contains following: [CONG] COL1;COL2;COL3;COL4 COL11;COL22:COL33;COL44 COL111;COL222;COL333;COL444 How can I read and populate a combobox or listbox as follows: COL1 COL11 COL111 then when I select an item (COL1 for example) from the list, it will read the forth item in the INI COL4 Any guidelines, direction or sample code will be greatly appreciated

    A Y 2 Replies Last reply
    0
    • A Anonymous

      I have an INI file that contains following: [CONG] COL1;COL2;COL3;COL4 COL11;COL22:COL33;COL44 COL111;COL222;COL333;COL444 How can I read and populate a combobox or listbox as follows: COL1 COL11 COL111 then when I select an item (COL1 for example) from the list, it will read the forth item in the INI COL4 Any guidelines, direction or sample code will be greatly appreciated

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      forgot to mention using VC++6 with/without MFC

      A 1 Reply Last reply
      0
      • A Anonymous

        I have an INI file that contains following: [CONG] COL1;COL2;COL3;COL4 COL11;COL22:COL33;COL44 COL111;COL222;COL333;COL444 How can I read and populate a combobox or listbox as follows: COL1 COL11 COL111 then when I select an item (COL1 for example) from the list, it will read the forth item in the INI COL4 Any guidelines, direction or sample code will be greatly appreciated

        Y Offline
        Y Offline
        Yulianto
        wrote on last edited by
        #3

        Why do you use .Ini file? get the value into CString; Find where are the ';', with CString.Find(";",0); Get the string with CString.Mid


        Work hard and a bit of luck is the key to success.

        :)

        A 1 Reply Last reply
        0
        • A Anonymous

          forgot to mention using VC++6 with/without MFC

          A Offline
          A Offline
          Anthony_Yio
          wrote on last edited by
          #4

          just tokenize it by using strtok, bear in mind however there are some issues on strtok. (check the MSDN) Sonork 100.41263:Anthony_Yio

          1 Reply Last reply
          0
          • Y Yulianto

            Why do you use .Ini file? get the value into CString; Find where are the ';', with CString.Find(";",0); Get the string with CString.Mid


            Work hard and a bit of luck is the key to success.

            :)

            A Offline
            A Offline
            Alan Chambers
            wrote on last edited by
            #5

            use the fgets() function to read each complete line into an array of char (or CString or whatever you use), then just trawl through it until you find a ';' character and set it to 0 or '\0'. Once you've done that add it the combo box and read in the next line... "When I left you I was but the learner, now I am the master" - Darth Vader

            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