Solved

where to save settings? C++

Posted on 2006-07-03
4
748 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

740 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