Re: Trying to use *.ini file as a database record



On Thu, 7 Jul 2005 10:17:30 -0400, "RAD Software"
<rad@xxxxxxxxxxxxxxx> wrote:

>I'm experimenting with using the
>
>GetPrivateProfileString and WritePrivateProfileString APIs
>
>as a way of creating and manipulating a database file.
>
>One of the first things I need to be able to do at program startup is get a
>list of the section names in the *.ini file.

<snip>

>So, using a 2.3mb *.ini file containing 8,181 section names, with about 10
>keynames in each section, I tried

Provided your INI file is not planned to grow too much, then you've
found an interesting way of skinning the cat.

Personally I intensely dislike the GetPrivateProfileString and
WritePrivateProfileString APIs

If you run FileMon and watch disk activity you'll get a fair idea of
one of the reasons why I loathe them.

Writing your own INI Class is quite easy, failing that you can look
around for one that someone has posted ( I've put one up before )

The advantage is that /you/ then have total control and can enhance it
to make it do exactly what you want, rather than jump through hoops.

It's worth thinking about
.



Relevant Pages

  • 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)
  • What is the problem with GetPrivateProfileString?
    ... GetPrivateProfileString 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. ... 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. ... 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 ...
    (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)