Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add a key to a ini file?
Message
 
To
12/11/2002 04:36:09
F Bilo
Bilo Office
Fuyang, China
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00721447
Message ID:
00721612
Views:
7
>I am trying to create a class to access ini file,and get this problem: How to add a key to a section? i use this:
>
>init event:
>*******************************************************************
>Declare WritePrivateProfileSection IN kernel32 As WriPrivSect ;
> STRING lpAppName,;
> STRING lpString,;
> STRING lpFileName
>*******************************************************************
>
>addkey method:
>*******************************************************************
>LPARAMETERS cSection, ckeyname
>
>LOCAL nResult
>nResult = WriPrivSect(cSection, ckeyname ,"", this.inifile)
>Return nResult
>*******************************************************************
>
>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.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform