Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to add a key to a ini file?
Message
 
À
12/11/2002 16:49:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00721447
Message ID:
00722061
Vues:
15
>>>
>>>Although it will work, but if i try to write a value for this key, always failed.The GetPrivateProfileString API always return this key's name!
>>>
>>>How can i do?
>>
>>In addition to Ed's reply, you can use my IniFiles class from the download section.
>
>
>I've been playing around with the IniFiles class this afternoon and found that the methods used to write keys don't work under Win2k (Win98 ok). The read methods work fine.
>
>Any ideas? I haven't played with REGISTRY.VCX yet but that's next on the list.

I just ran a test under Win2K Pro SP3 without a problem. The file, BTW, didn't originally exist.
SET PROCEDURE TO inifiles ADDITIVE
oIni = CREATEOBJECT('Ini_Files')
lcini = ADDBS(SYS(5) + SYS(2003)) + 'foo.ini'
oIni.PutIniEntry('geo', 'entry', 'value', lcini)
* File was created with the appropriate entry
oIni.PutIniEntry('geo', 'entry2', 'value2', lcini)
* New entry was added
Are you, by any chance trying to write to WIN.INI?
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform