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
Solved

where to save settings? C++

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

This article will show, step by step, how to integrate R code into a R Sweave document
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

840 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