Solved

where to save settings? C++

Posted on 2006-07-03
4
744 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
array220 challenge 8 56
wordappend challenge 8 149
Program to display an alert on Windows Toolbar 2 71
listing all functions in JavaScript 19 179
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

867 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

16 Experts available now in Live!

Get 1:1 Help Now