Article View: comp.os.ms-windows.programmer.misc
Article #2471does GetPrivateProfileString work with lpszEntry= NULL?
From: John Grant
Date: Tue, 05 Jan 1993 03:45
Date: Tue, 05 Jan 1993 03:45
46 lines
1633 bytes
1633 bytes
I'm trying to get GetPrivateProfileString() to work for the case
where lpszEntry is NULL - no success. The following may also apply
to GetProfileString() as well (for WIN.INI).
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.
It doesn't work if I use "" instead of NULL either, and yet if I use
"abc", sure enough I get "xxx", so I know I'm doing something right.
Supplementary Question #1
Assuming I can get this to work, will I be able to read:
[stuff]
xxx
yyy
xxx
when using lpszEntry=NULL, or does each item require a keyword?
Supplementary Question #2
If I have:
[stuff]
abc=xxx
abc=yyy
abc=zzz
and I ask for entry "abc", will I get:
(a) nothing
(b) "xxx" the first one
(c) "zzz" the last one
John A. Grant jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
--
John A. Grant jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Technical Details
Message-ID:
<1993Jan5.034504.10386@emr1.emr.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!cs.utexas.edu!torn!nott!emr1!jagrantShow Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc Path: arc1-ca.pugleaf.net!sparky!uunet!usc!cs.utexas.edu!torn!nott!emr1!jagrant From: jagrant@emr1.emr.ca (John Grant) Subject: does GetPrivateProfileString work with lpszEntry= NULL? Message-ID: <1993Jan5.034504.10386@emr1.emr.ca> Organization: Energy, Mines, and Resources, Ottawa Date: Tue, 5 Jan 1993 03:45:04 GMT Lines: 46