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. Read ini file?

Read ini file?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionannouncement
4 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.
  • Z Offline
    Z Offline
    zt9788
    wrote on last edited by
    #1

    I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run. Can anybody help me? Thanks. void update() { .... free((void*)m_pszRegistryKey); m_pszRegistryKey = NULL; free((void*)m_pszProfileName); m_pszProfileName =_tcsdup(szPath); ....} ... { AfxGetApp()->GetProfileString(......); } ... hi

    G H T 3 Replies Last reply
    0
    • Z zt9788

      I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run. Can anybody help me? Thanks. void update() { .... free((void*)m_pszRegistryKey); m_pszRegistryKey = NULL; free((void*)m_pszProfileName); m_pszProfileName =_tcsdup(szPath); ....} ... { AfxGetApp()->GetProfileString(......); } ... hi

      G Offline
      G Offline
      grigsoft
      wrote on last edited by
      #2

      You can check in sources what is wrong there (maybe it caches open file handle), but why don't you use GetPrivateProfilexxx functions directly? Igor Green http://www.grigsoft.com/ - files and folders comparison tools

      1 Reply Last reply
      0
      • Z zt9788

        I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run. Can anybody help me? Thanks. void update() { .... free((void*)m_pszRegistryKey); m_pszRegistryKey = NULL; free((void*)m_pszProfileName); m_pszProfileName =_tcsdup(szPath); ....} ... { AfxGetApp()->GetProfileString(......); } ... hi

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        See How to read and write an INI File[^] maybe it is some helpful to you_**


        **_

        whitesky


        1 Reply Last reply
        0
        • Z zt9788

          I have a program with some ini profile files. For dynamicly changing profile files when the app is running, i change the m_pszProfileName value which is a attribute of the App Class. But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run. Can anybody help me? Thanks. void update() { .... free((void*)m_pszRegistryKey); m_pszRegistryKey = NULL; free((void*)m_pszProfileName); m_pszProfileName =_tcsdup(szPath); ....} ... { AfxGetApp()->GetProfileString(......); } ... hi

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          zt9788 wrote:

          But some problems bother me, the values are loaded correctly for each ini file when the app first running, while it does'nt work after i changed the m_pszProfileName value when the app run.

          try these INI file reading wrapper class:- INI FILE reader![^]

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV

          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