What is the problem with GetPrivateProfileString?

Tech-Archive recommends: Fix windows errors by optimizing your registry



GetPrivateProfileString (aliased to GetPrivateProfileStringA) called from VB5 SP3 works GREAT on my XP machine, but on my '98 machine it just returns a blank buffer and a zero length indication regardless of what is in the INI file. It doesn't even return the value of the default argument!

I made the call to WritePrivateProfileString with all arguments except for the filename NULL to map the INI file to the registry, but it doesn't seem to be hiding in there as a result.

Otherwise, WritePrivateProfileString seems to be writing the INI file OK on the '98 machine, I just can't read it back in with GetPrivateProfileString.

Like most Microsoft problems I run into, this one has also had lots of postings along with replies the don't work, but apparently no one has yet found the magic solution to this problem on non-NT machines.

Thanks in advance for any help that you can provide. As always, I DO post the workable solutions I find to save others the same problems.

Steve Richfie1d
.



Relevant Pages

  • Re: Trying to use *.ini file as a database record
    ... >GetPrivateProfileString and WritePrivateProfileString APIs ... >as a way of creating and manipulating a database file. ... Provided your INI file is not planned to grow too much, ...
    (comp.lang.basic.visual.misc)
  • Re: Trying to use *.ini file as a database record
    ... >GetPrivateProfileString and WritePrivateProfileString APIs ... >list of the section names in the *.ini file. ... Public Sub DeleteEntry(sSectionName As String, ... '' Can't get WritePrivateProfileString to accept a Null, ...
    (comp.lang.basic.visual.misc)
  • Re: What is the problem with GetPrivateProfileString?
    ... > GetPrivateProfileString called ... > for the filename NULL to map the INI file to the registry, ... > yet found the magic solution to this problem on non-NT machines. ...
    (microsoft.public.vb.enterprise)
  • Re: Reg GetPrivateProfileString
    ... >I am trying to use GetPrivateProfileString() for ini file io. ... >is not using MFC. ... I, of course, tried to use google. ...
    (microsoft.public.pocketpc.developer)
  • Deleting INI file entry
    ... I'm using GetPrivateProfileString and WritePrivateProfileString for IO to an ... How does one delete an trying within an INI file? ... Adam ...
    (microsoft.public.dotnet.languages.vb)