Solved

where to save settings? C++

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A short article about problems I had with the new location API and permissions in Marshmallow
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 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…

738 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