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. ini files

ini files

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

    I have a problem . When I want to create .INI file with some SECTIONs and I want to insert SPACE among them . Ex. : [Section1] data1 = ... data2 = ... <= there I want to create the SPACE [Section2] Best regards. Tomas

    N 1 Reply Last reply
    0
    • S scara

      I have a problem . When I want to create .INI file with some SECTIONs and I want to insert SPACE among them . Ex. : [Section1] data1 = ... data2 = ... <= there I want to create the SPACE [Section2] Best regards. Tomas

      N Offline
      N Offline
      Nitron
      wrote on last edited by
      #2

      :confused: ?? huh? Does:

      outfile << "data2 = " << data2 << "\n\n" << "[Section2]\n";

      not work?? - Nitron


      "Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb

      S 1 Reply Last reply
      0
      • N Nitron

        :confused: ?? huh? Does:

        outfile << "data2 = " << data2 << "\n\n" << "[Section2]\n";

        not work?? - Nitron


        "Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb

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

        this can be right, but I adding rows to the ini file by WritPrivateProfileString and I can`t make the SPACE !!! I tryied many ways to make the SPACE but I don`t be successful . thank you Tomas

        D 1 Reply Last reply
        0
        • S scara

          this can be right, but I adding rows to the ini file by WritPrivateProfileString and I can`t make the SPACE !!! I tryied many ways to make the SPACE but I don`t be successful . thank you Tomas

          D Offline
          D Offline
          Dave_
          wrote on last edited by
          #4

          I think you would need to flush the file after doing your WritePrivateProfileStrings(), and then go back and open it using something like a CStdioFile to write the blank lines. You could also do it with a binary file, I don't know which would be easier. The point is that WritePrivateProfileString does not have an option to do this as far as I know. I have been using this function for a long time, and have never seen a way to do this wihtout manually writing to the file. I could be wrong. It's happened many times before. Good luck.

          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