viksoe.dk

CIni class

A small MFC class that wraps the Windows .INI configuration file API.

Break free of the limitations of the MFC app->WriteProfileString() programming style. With this little class you can easily access any .INI file on your hard-drive.

Interface

 NameDescription
SetIniFilenameSets the current Ini-file to use.
GetIntReads an integer from the ini-file.
GetBooleanReads a boolean value from the ini-file.
GetStringReads a string from the ini-file.
GetBinaryReads a binaryt lump of data from the ini-file.
WriteIntWrites an integer to the ini-file.
WriteBooleanWrites a boolean value to the ini-file.
WriteStringWrites a string to the ini-file.
WriteBinaryWrites a binary lump of data to the ini-file.
WriteExpandStringWrites an 'expand string' to the ini-file.
DeleteKeyRemoves an item from the current ini-file.
DeleteSectionRemoves a complete section from the ini-file.

Notes

Yes, I could have made one Write() function with a bunch of argument overloads, but that's not possible for the Get() function (it returns data) and I wanted to make it consistent.

Source Code Dependencies

Microsoft MFC Library
My Global MFC functions

See Also

Registry class

Download Files

DownloadSource Code (3 Kb)


Written by Bjarke Viksoe.
Article submitted 10/1/2000.