Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am working with a MFC application for the first time and I have lots of doubts the biggest at the moment is What is .ini file and why is it there? What exactly is the role it plays? Can some tell me the required?

Edit : What if I make an application and do not have .ini file, what do I loose on?

share|improve this question
1  
.ini files are typically configuration files. See: en.wikipedia.org/wiki/INI_file –  Yannis Rizos Sep 20 '12 at 10:21
    
As akton pointed out an INI file is just an old settings file. Rather make use of the app.config to store your application settings. –  user65439 Sep 20 '12 at 13:03
add comment

2 Answers 2

INI files are an old way of storing application configuration, particularly in Windows 3.x, such as WIN.INI, and Windows 9x, and SYSTEM.INI. Windows NT used BOOT.INI as part of its boot process. Later applications used registry keys and more recent .Net applications store settings in app.config XML files.

share|improve this answer
    
What if I do not include ini file? What loss would I do to the application? –  vin Sep 20 '12 at 10:43
    
@vin If your application has no configurable settings, excluding an INI file has no impact. If your application has settings, such as a list files opened or database connection string, they need to be stored somewhere. Storing them in a plain text file, like an INI file or XML file, allows humans to easily see and edit the settings but storing the file can be difficult ("Program Files" is often read only) and per user settings may need to be separate to shared settings. The registry supports per user settings easily but is harder to view/edit and can be corrupted. –  akton Sep 20 '12 at 10:48
    
Inifiles seem to be back in fashion for windows apps these days. –  Pieter B Sep 20 '12 at 13:42
add comment

Old and recent softwares use INI files, like OpenOffice.org and Mercurial. The problem of the INI format is simple : there is no standard. Some implementations allow advanced features (key references, Unicode support, etc), others not.

If you want a Properties file with "sections" (like "[foo]"), INI is a good choice. It has the same role as Properties, CFG, CONFIG, XML, PO, etc.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.