Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Problem with GetPrivateProfileString() Date: Tue, 5 Jul 2016 11:24:05 +0200 Lines: 57 Message-ID: References: <0a08cc3b-7ab7-4a57-b9f2-ca872dc1f93d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net FPxqnkCBBzCbRwb0rb1wggT9kLHNg1fptmMhaViEUAT1wDgNg= Cancel-Lock: sha1:8uI6tpQTg3o+/uesd6U2k0EO2MA= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:9502 Hi Jürgen, please pay attention that the program files directory and the windows directory have special handlings when a process tries to write there. To be compatible with Windows 7/8/10 you should NEVER write anything there. If your program or another program tries this, the following can occur: 1) if the writing program is manifested for Windows 7/8/10, and the process has not elevated rights, the write will fail. 2) if the writing program is not manifested for newer Windows versions, the ini or whatever file is written to the virtual store hierarchy of the current user, so the configuration data is not shared between different users, and could also not be shared between different applications. I don't know if GetPrivateProfileString() is not trying to write and fails therefore - it is a Windows API function, not a VO function. My strong recommendation is to never install programs that are using configuration data or, even worser, application data (like nearly all my VO programs do) into the Program Files structure - better to install them in a separate directory. Programs installed into the Program Files structure should put their configuration and data in the (hidden) ProgramData structure. Wolfgang Jürgen Knauf wrote: > GetPrivateProfileString() is not workiung correctly. > > > When I try to read an empty value from an INI-File, I do not get the > alternate value back. > > pszFile := "C:\Program Files (x86)\texManager 8\tm.ini" > pszBuffer := Space(127) > > GetPrivateProfileString("PFADE","LOCALAPP","ABCDE",pszBuffer,127,pszFi > le) > > ? pszBuffer > In this case it must be "ABCDE", but I get an empty value. > > Windows 10 64-Bit, Vo 2.8 > > Jürgen --