Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #9502

Re: Problem with GetPrivateProfileString()

From "Wolfgang Riedmann" <wriedmann@gmail.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Problem with GetPrivateProfileString()
Date 2016-07-05 11:24 +0200
Message-ID <du1clmFe89oU1@mid.individual.net> (permalink)
References <0a08cc3b-7ab7-4a57-b9f2-ca872dc1f93d@googlegroups.com>

Show all headers | View raw


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



-- 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Problem with GetPrivateProfileString() Jürgen Knauf <trotterklaus@googlemail.com> - 2016-07-04 23:10 -0700
  Re: Problem with GetPrivateProfileString() "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2016-07-05 09:41 +0200
  Re: Problem with GetPrivateProfileString() "Wolfgang Riedmann" <wriedmann@gmail.com> - 2016-07-05 11:24 +0200
  Re: Problem with GetPrivateProfileString() Jürgen Knauf <trotterklaus@googlemail.com> - 2016-07-06 00:55 -0700
  Re: Problem with GetPrivateProfileString() "Jean Raymond" <jean_ray67@hotmail.com> - 2016-07-07 08:10 -0400
    Re: Problem with GetPrivateProfileString() Jürgen Knauf <trotterklaus@googlemail.com> - 2016-07-08 04:18 -0700

csiph-web