Solved

where to save settings? C++

Posted on 2006-07-03
4
743 Views
Last Modified: 2009-12-16
i am making a program, going to have over 300 customable settings... not sure the best place to store the settings, the registry an .ini file or what??? i know that if i have an ini file with over 300 enteries it will slow the program down, which would be the best way to do this (i have also thought about multiple ini files)
0
Comment
Question by:crims
4 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 17029843
Recommended way is using Registry. If you have some reasons to do this using ini file, you can do this as well. Both Registry functions and functions working with ini files, like WritePrivateProfileString, are optimized and don't slow down program working with 300 entries.
0
 
LVL 32

Expert Comment

by:jhance
ID: 17029925
INI files are obsolete and in Microsoft's opinion should not be used any more (although THEY STILL use them!!).  The most common place today is the registry although with newer apps that is changing...

The new place to keep application settings is in a file in XML format.  If you look at where much of the newest Microsoft software is keeping settings, it's in configuration files in XML format.
0
 
LVL 15

Accepted Solution

by:
bpmurray earned 125 total points
ID: 17029940
With that number of settings, avoiding the hit when you load them is important. Perhaps a bespoke settings file is the solution. You can serialize your settings class and read it in when you start, so the load will occur in a single read.
0
 
LVL 7

Expert Comment

by:yotamsher
ID: 17031425
Another aspect to take into consideration, is the nature of the "settings"
for example, if it is just a list of values, the .ini file (though not "modern"), is very efficient, in both read, and write (and maintanence), and each value can be read only when needed..
but if the data, is more structured, ( properties, sub properties, optional settings etc.) then you are left with the other two options:
1) registry: very fast, has permissionning has parts which are per user, and parts global
2) XML file(s): easier to use (there is always a parser around) better structured, and the files can be copied and used accross computers.

not an easy decision ha?

if you need a more specific answer, you'll need to give a more detailed picture of your settings.

regarding serialization to binary file, well it is tempting in terms of performance, but I'd use it only if everything else fails.

Yotam
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now