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. GetPrivateProfileString method: problems on Windows Vista

GetPrivateProfileString method: problems on Windows Vista

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

    Hello, I have a problem reading data from a INI file using GetPrivateProfileString method, only on Windows Vista. When I read from a CFG file no problem, but GetPrivateProfileString always return the default value reading a INI file located on Windows directory (C:\Windows). Anybody knows this problem? Thanks, Cris.

    D 1 Reply Last reply
    0
    • C Cris

      Hello, I have a problem reading data from a INI file using GetPrivateProfileString method, only on Windows Vista. When I read from a CFG file no problem, but GetPrivateProfileString always return the default value reading a INI file located on Windows directory (C:\Windows). Anybody knows this problem? Thanks, Cris.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Cris wrote:

      Anybody knows this problem?

      Probably related to Vista's UAC.


      "A good athlete is the result of a good and worthy opponent." - David Crow

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      C 1 Reply Last reply
      0
      • D David Crow

        Cris wrote:

        Anybody knows this problem?

        Probably related to Vista's UAC.


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        C Offline
        C Offline
        Cris
        wrote on last edited by
        #3

        Thats right... I have fixed my problem reseting the UAC configuration. But, why the UAC configuration cause this problem? []'s Cris.

        D 1 Reply Last reply
        0
        • C Cris

          Thats right... I have fixed my problem reseting the UAC configuration. But, why the UAC configuration cause this problem? []'s Cris.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Cris wrote:

          But, why the UAC configuration cause this problem?

          Because you were trying to access an object in the c:\windows folder. Most everything in Vista has been locked down.


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          E M 2 Replies Last reply
          0
          • D David Crow

            Cris wrote:

            But, why the UAC configuration cause this problem?

            Because you were trying to access an object in the c:\windows folder. Most everything in Vista has been locked down.


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            E Offline
            E Offline
            El Corazon
            wrote on last edited by
            #5

            DavidCrow wrote:

            Because you were trying to access an object in the c:\windows folder.

            bingo... you beat me to it. I am trying to be good an hang out here more often. ;)

            _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

            1 Reply Last reply
            0
            • D David Crow

              Cris wrote:

              But, why the UAC configuration cause this problem?

              Because you were trying to access an object in the c:\windows folder. Most everything in Vista has been locked down.


              "A good athlete is the result of a good and worthy opponent." - David Crow

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

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

              Why would UAC interfere with a call to read an INI file?

              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen

              E 1 Reply Last reply
              0
              • M Michael Dunn

                Why would UAC interfere with a call to read an INI file?

                --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen

                E Offline
                E Offline
                El Corazon
                wrote on last edited by
                #7

                Michael Dunn wrote:

                with a call to read an INI file?

                you are outside of your "accessable" directories. Even in XP you can restrict access to windows, or program files. theoretically you should only have read or write access to your program's director and sub-directories. even if you were to try ../common/config.ini if you have security set to full it will refuse you read access. We had to get an exception for our software for a few years until I got everything moved to the install folder... bad habits die hard...

                _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                M 1 Reply Last reply
                0
                • E El Corazon

                  Michael Dunn wrote:

                  with a call to read an INI file?

                  you are outside of your "accessable" directories. Even in XP you can restrict access to windows, or program files. theoretically you should only have read or write access to your program's director and sub-directories. even if you were to try ../common/config.ini if you have security set to full it will refuse you read access. We had to get an exception for our software for a few years until I got everything moved to the install folder... bad habits die hard...

                  _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

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

                  That still doesn't explain why would UAC interfere with a call to read an INI file. Restricting access to \windows makes no sense - how would you use the computer if you couldn't access \windows?

                  --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

                  E 1 Reply Last reply
                  0
                  • M Michael Dunn

                    That still doesn't explain why would UAC interfere with a call to read an INI file. Restricting access to \windows makes no sense - how would you use the computer if you couldn't access \windows?

                    --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

                    E Offline
                    E Offline
                    El Corazon
                    wrote on last edited by
                    #9

                    Michael Dunn wrote:

                    That still doesn't explain why would UAC interfere with a call to read an INI file. Restricting access to \windows makes no sense - how would you use the computer if you couldn't access \windows?

                    No one is supposed to have direct access to windows, windows does, but not the programs. We've just been too accustomed to lower security.

                    _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                    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