home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4590 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.5 KB  |  56 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!usc!cs.utexas.edu!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: does GetPrivateProfileString work with lpszEntry= NULL?
  5. Message-ID: <1993Jan5.034504.10386@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. Date: Tue, 5 Jan 1993 03:45:04 GMT
  8. Lines: 46
  9.  
  10. I'm trying to get GetPrivateProfileString() to work for the case
  11. where lpszEntry is NULL - no success.  The following may also apply
  12. to GetProfileString() as well (for WIN.INI).
  13.  
  14. Suppose I have the following in my xxx.ini file:
  15.     [stuff]
  16.     abc=xxx
  17.     def=yyy
  18.     ijk=zzz
  19. Then, supposedly I should be able to get the whole [stuff] section with
  20. char buffer[100];
  21.     GetPrivateProfileString("stuff",NULL,"failed",buffer,
  22.             sizeof(buffer),"xxx.ini");
  23. and yet I only get "failed" and I should get:
  24.     "xxx\0yyy\0zzz\0\0"
  25. or so it says in the docs.
  26.  
  27. It doesn't work if I use "" instead of NULL either, and yet if I use
  28. "abc", sure enough I get "xxx", so I know I'm doing something right.
  29.  
  30. Supplementary Question #1
  31.   Assuming I can get this to work, will I be able to read:
  32.     [stuff]
  33.     xxx
  34.     yyy
  35.     xxx
  36.   when using lpszEntry=NULL, or does each item require a keyword?
  37.  
  38. Supplementary Question #2
  39.   If I have:
  40.     [stuff]
  41.     abc=xxx
  42.     abc=yyy
  43.     abc=zzz
  44.   and I ask for entry "abc", will I get:
  45.     (a) nothing
  46.     (b) "xxx" the first one
  47.     (c) "zzz" the last one
  48.  
  49. John A. Grant                        jagrant@emr1.emr.ca
  50. Airborne Geophysics
  51. Geological Survey of Canada, Ottawa
  52. -- 
  53. John A. Grant                        jagrant@emr1.emr.ca
  54. Airborne Geophysics
  55. Geological Survey of Canada, Ottawa
  56.