Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to add a key to a ini file?
Message
De
15/11/2002 15:41:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00721447
Message ID:
00723410
Vues:
11
>>>>
>>>>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, it worked fine on a couple of other pc's. I've spent the last two days reloading Win2k and my apps and now the class works perfectly. Problem solved.
-Henry-
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform