home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4619 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.5 KB

  1. Path: sparky!uunet!paladin.american.edu!gatech!emory!ogicse!news.u.washington.edu!sumax.seattleu.edu!sumax.seattleu.edu!not-for-mail
  2. From: kburrows@sumax.seattleu.edu (Kevin Burrows)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: does GetPrivateProfileString work with lpszEntry= NULL?
  5. Message-ID: <1idd6oINNmkj@sumax.seattleu.edu>
  6. Date: 5 Jan 93 09:38:32 GMT
  7. Article-I.D.: sumax.1idd6oINNmkj
  8. References: <1993Jan5.034504.10386@emr1.emr.ca>
  9. Organization: Seattle University
  10. Lines: 34
  11. NNTP-Posting-Host: sumax.seattleu.edu
  12.  
  13. In article <1993Jan5.034504.10386@emr1.emr.ca> jagrant@emr1.emr.ca (John Grant) writes:
  14.  
  15.  
  16. >I'm trying to get GetPrivateProfileString() to work for the case
  17. >where lpszEntry is NULL - no success.  
  18.  
  19. >Suppose I have the following in my xxx.ini file:
  20. >    [stuff]
  21. >    abc=xxx
  22. >    def=yyy
  23. >    ijk=zzz
  24. >Then, supposedly I should be able to get the whole [stuff] section with
  25. >char buffer[100];
  26. >    GetPrivateProfileString("stuff",NULL,"failed",buffer,
  27. >            sizeof(buffer),"xxx.ini");
  28. >and yet I only get "failed" and I should get:
  29. >    "xxx\0yyy\0zzz\0\0"
  30. >or so it says in the docs.
  31.        ^^^^^^^^^^^^^^^^^^^
  32. Take another look at the docs...
  33.  
  34. I have successfully used a GetPrivateProfileString call which is similar 
  35. to yours; I am puzzled by why your call is failing.  Perhaps this 
  36. observation may be useful:
  37.  
  38.     When lpszEntry is NULL, GetPrivateProfileString returns the 
  39.     keynames NOT their values. Therefore, you should expect buffer to 
  40.     contain:
  41.          "abc\0\def\0ijk\0\0"
  42.  
  43. Good Luck.
  44.  
  45. Kevin
  46. kburrows@sumax.seattleu.edu
  47.