GetPrivateProfileString method: problems on Windows Vista
-
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.
-
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.
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
-
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
-
Thats right... I have fixed my problem reseting the UAC configuration. But, why the UAC configuration cause this problem? []'s Cris.
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
-
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
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)
-
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
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
-
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
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)
-
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)
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
-
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
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)