-
INI FILE
C++ Gurus,
I Would like to create (this i would do it manually) an INI file, and read the properties from this file
Ex: if system.ini is the file name.
It would contain the properties like
System_Name=mysystem
Visible=true
From a CPP program i should be able to read the file and get the property i need,
char *a = getvalue("System_Name");
How do i do this ?
Any help on this would be appreiciated
Thanks!
-
Re: INI FILE
you have to read the file into a string variable and then find the position of the start of the text that u want,
I hope u know how to read the file into string, if not, refer http://vblib.virtualave.net for a function call ReadFileStr in vbFileIO class.
say you got it into a variable call s,
then you need to get the start position, like this
l = instr(s,"System_Name=")
j = len("System_Name=")
k = len("mysystem")
after getting it, you can then use
x = mid(s,l+j,k)
if the file is INI, you might want to consider GetPrivateProfileString API to do it.
cksiow
http://vblib.virtualave.net - share our codes
-
Re: INI FILE
Should not this be posted in C forum, to get quicker answer?
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
-
Re: INI FILE
DO you want it in C++ or in VB?
Iouri Boutchkine
[email protected]
-
Re: INI FILE
Yes i want this in C++, also if possible could you send me a link to any examples if you have.
Thanks for all the help!!
-
Re: INI FILE