Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enumerate INI Files
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00443325
Message ID:
00445272
Views:
15
I can't seem to get the desired behavior. Is this correct?

>DECLARE INTEGER GetPrivateProfileString IN Win32API ;
> STRING cSection, STRING cKey, STRING cDefault, STRING @cBuffer, ;
> INTEGER nBufferSize, STRING cINIFile
>
>lcBuffer=space(255)
>
>GetPrivateProfileString("ENVIRONMENT", "", "",;
> @lcBuffer, LEN(lcBuffer), "C:\DEFAULT.INI")
>
>?lcBuffer

Instead of getting a list of the keys in the section, the buffer variable remains the same.




>Hi Troy,
>
>The GetPrivateProfileString() API function will return a list of the keys in a section if you only pass it the section name. From MSDN:
>
>

>
>
lpKeyName

>
>
[in] Pointer to the null-terminated string specifying the name of the key whose associated string is to be retrieved. If this parameter is NULL, all key names in the section specified by the lpAppName parameter are copied to the buffer specified by the lpReturnedString parameter.

>
>Cheers,
>
>Andrew
>
>>How can I enumerate through a section of an INI file to get a list of the entries?
>>
>>Thanks,
>>Troy
Previous
Reply
Map
View

Click here to load this message in the networking platform