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


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

Re: Problem with GetPrivateProfileString()

From "Jean Raymond" <jean_ray67@hotmail.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Problem with GetPrivateProfileString()
Date 2016-07-07 08:10 -0400
Organization A noiseless patient Spider
Message-ID <nllgrc$k36$1@dont-email.me> (permalink)
References <0a08cc3b-7ab7-4a57-b9f2-ca872dc1f93d@googlegroups.com>

Show all headers | View raw


REf: 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724353(v=vs.85).aspx

lpDefault [in]
A default string. If the lpKeyName key cannot be found in the initialization 
file, GetPrivateProfileString copies the default string to the 
lpReturnedString buffer. If this parameter is NULL, the default is an empty 
string, "".

As far as I know, only if the key [LOCALAPP] is not found, then it will 
return [ABCDE] default value.
If the key is found, then it will return a NULL_STRING, and this is correct.

No where here they say that if the value is empty, then it will return the 
[ABCDE] default value.

My humble opinion...

Jean Raymond
http://www.rayonline.com




/-----------------------------------------------------------------------------------------------------------------------------------

"Jürgen Knauf"  wrote in message 
news:0a08cc3b-7ab7-4a57-b9f2-ca872dc1f93d@googlegroups.com...

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,pszFile)

? 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