nimitt
asked on
Creation of INI files in VC++
Dear Sir/Madam,
How can I create my own ini file by VC++ code?I want create ny 1 own ini file and then write certain information in that.So how can I doi this?Which class and functions are there in VC++ for this purpose?
Thank you in advance.
Nimitt.
How can I create my own ini file by VC++ code?I want create ny 1 own ini file and then write certain information in that.So how can I doi this?Which class and functions are there in VC++ for this purpose?
Thank you in advance.
Nimitt.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
If you are using MFC you can use the following functions of CWinApp derived class.
* SetRegistryKey()
* WriteProfileInt()
* WriteProfileString()
* GetProfileInt()
* GetProfileString()
Now the applications store the data in the windows registry instead of .ini files. If you do not use call to SetRegistryKey("Applicatio n name") then your data will be stored in .ini files.
-PK
If you are using MFC you can use the following functions of CWinApp derived class.
* SetRegistryKey()
* WriteProfileInt()
* WriteProfileString()
* GetProfileInt()
* GetProfileString()
Now the applications store the data in the windows registry instead of .ini files. If you do not use call to SetRegistryKey("Applicatio
-PK
The CWinApp class has a member m_pszProfileName witch contains the path of the app's .ini file.
To read and write form the file use the folowing functions:
GetProfileInt
WriteProfileInt
GetProfileString
WriteProfileString
witch are also members of CWinApp class.
To read and write form the file use the folowing functions:
GetProfileInt
WriteProfileInt
GetProfileString
WriteProfileString
witch are also members of CWinApp class.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: Zoppo
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Roshan Davis
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: Zoppo
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Roshan Davis
EE Cleanup Volunteer
ps. Microsoft recommend you use the registry. Maybe a future version of VC++ will pull support of ini files away completely?