Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enumerate INI Files
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00443325
Message ID:
00445272
Vues:
23
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform