Hello,
I was wondering if someone can provide me with an example on how to write/read from the registry using the CRegKey class. I have never worked with the registry so please provide as much detail as possible. I basically need is to save a bunch of values from different dialog boxes, in other words to save a configuration. I want to have an entry in registry with my company name, and under there and entry for the software program and then the configurations. So I was to view it using regedit it would look something like this:
myComanyName
softwareName
Configurations
ConfigurationName1 (name of configuration as saved by the user)
checkbox1 = TRUE or FALSE (some data stored so when I read it I can tell if it was selected or not)
checkbox2 = TRUE or FALSE (TRUE means it was checked)
checkbox3 = TRUE or FALSE
....... (I will be storing about 40+ different data for each configuration)
ConfigurationName2
checkbox1 = TRUE or FALSE
checkbox2= TRUE or FALSE
checkbox3 = TRUE or FALSE
I want to call the functions (method) to save to the registry when the user clicks on "Save" button from within my own child dialog box I created, is that best place to write to the registry?
User will be able to click on a "Load Configuration" button from the main window or from the File menu, which will cause a child dialog box to appear(I already build the dialog box), I want to display all the current configurations saved in the registry, so I need to iterate through each one, get the configuration name and add it to my list. After that the user will select a configuration, I then need to query each checkbox value to set my checkbox controls accordingly. Is there an easy way to do this using CRegKey? and if so, example(s)?
Thanks.
Start Free Trial