home *** CD-ROM | disk | FTP | other *** search
- Path: 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
-
- 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
-