Jump to content

Arrays and registry question


Recommended Posts

I'm about to switch over from ini to registry. Currently I'm looking at two options in how to set up the way my app communicates with the registry.

1/ Save registry entries in a few REG_MULTI_SZ(A "few" because of manageability), in doing this I would be reading the info back to a few arrays. 6 arrays off the top of my head, that doesn't include the arrays that the program itself makes for other functions.

OR

2/ Save each registry entry in their own REG_SZ, in doing this the GUI will be reading entries back individually, like an ini. And the array count will be left to what the app makes alone.

My question is which is better? Is there an array amount/count that I shouldn't reach for sake of memory? Is it better to read from a multi_sz and then parse it regardless of the amount of arrays created for speed, or is it better to read from individual reg_sz for memory?

Edited by Champak
Link to comment
Share on other sites

Another question, is it possible to insert a particular value...overwritting the previous value, in a reg_multi_sz? Let's say a value is the 7th value into a reg_multi_sz, and I want to overwrite that one particular value, can I do that without rewriting/saving the entire reg_multi_sz?

Link to comment
Share on other sites

I've done both the Multi and the Single. After using both to store various stuff I much prefer to use as many singles as I need. But thats just me. Either would work fine.

I also make all my programs write to the same place in general. I for example use 'HKEY_CURRENT_USER\Software\Calvin\' Then the Program name and then whatever keys I need for that script. Its just personal preference. But it makes finding stuff simpler for trouble shooting later on.

If your vars are changing often I tend to keep them in arrays in memory and only write them to the reg on exit. But it depends entirely on what your doing and why.

I believe that multi reg entries must be read or written to fully.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...