Article View: comp.os.ms-windows.programmer.misc
Article #2498Re: does GetPrivateProfileString work with lpszEntry= NULL?
From: Kevin Burrows
Date: Tue, 05 Jan 1993 09:38
Date: Tue, 05 Jan 1993 09:38
34 lines
1602 bytes
1602 bytes
In article <1993Jan5.034504.10386@emr1.emr.ca> jagrant@emr1.emr.ca (John Grant) writes:
>I'm trying to get GetPrivateProfileString() to work for the case
>where lpszEntry is NULL - no success.
>Suppose I have the following in my xxx.ini file:
> [stuff]
> abc=xxx
> def=yyy
> ijk=zzz
>Then, supposedly I should be able to get the whole [stuff] section with
>char buffer[100];
> GetPrivateProfileString("stuff",NULL,"failed",buffer,
> sizeof(buffer),"xxx.ini");
>and yet I only get "failed" and I should get:
> "xxx\0yyy\0zzz\0\0"
>or so it says in the docs.
^^^^^^^^^^^^^^^^^^^
Take another look at the docs...
I have successfully used a GetPrivateProfileString call which is similar
to yours; I am puzzled by why your call is failing. Perhaps this
observation may be useful:
When lpszEntry is NULL, GetPrivateProfileString returns the
keynames NOT their values. Therefore, you should expect buffer to
contain:
"abc\0\def\0ijk\0\0"
Good Luck.
Kevin
kburrows@sumax.seattleu.edu
Technical Details
Message-ID:
<1idd6oINNmkj@sumax.seattleu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!gatech!emory!ogicse!news.u.washington.edu!sumax.seattleu.edu!sumax.seattleu.edu!not-for-mailReferences:
<1993Jan5.034504.10386@emr1.emr.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!gatech!emory!ogicse!news.u.washington.edu!sumax.seattleu.edu!sumax.seattleu.edu!not-for-mail From: kburrows@sumax.seattleu.edu (Kevin Burrows) Newsgroups: comp.os.ms-windows.programmer.misc Subject: Re: does GetPrivateProfileString work with lpszEntry= NULL? Message-ID: <1idd6oINNmkj@sumax.seattleu.edu> Date: 5 Jan 93 09:38:32 GMT Article-I.D.: sumax.1idd6oINNmkj References: <1993Jan5.034504.10386@emr1.emr.ca> Organization: Seattle University Lines: 34 NNTP-Posting-Host: sumax.seattleu.edu