|
-
April 12th, 2001, 05:01 PM
#1
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!
-
April 12th, 2001, 07:22 PM
#2
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
-
April 13th, 2001, 06:03 AM
#3
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.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
April 13th, 2001, 07:05 AM
#4
Re: INI FILE
DO you want it in C++ or in VB?
Iouri Boutchkine
[email protected]
-
April 16th, 2001, 06:27 PM
#5
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!!
-
April 16th, 2001, 07:07 PM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|