Re: product activation info

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



another important one:
in the RegCreateKeyEx()->dwOptions:
i should use:
REG_OPTION_NON_VOLATILE
?

M

"Starglider 4 (Marco Knoester)" <rebel-6-out@xxxxxxxxx> schreef in bericht
news:4972850b$0$30610$9a622dc7@xxxxxxxxxxxxxxxxxxxx
Yes. i have a modal product actviation dialog.
And i have made it a habit to keep most things as
basic/simple as possible. (most of the time it results in the fastest code
as well).
i'm going to write 2 functions right now:
1 open/create all values
(if you use regkeycreateEx() existing keys are autom. 'opened', so
regkeycreateEx() is perfect.)
2 save all values/close all keys
and ofcourse the processing/decision-making 'in between' in the modal
dialog.

M

"Alec S." <nospam@xxxxxxxxx> schreef in bericht
news:OuH4XZPeJHA.3864@xxxxxxxxxxxxxxxxxxxxxxx
Starglider 4 (Marco Knoester) wrote (in
news:4972173b$0$30619$9a622dc7@xxxxxxxxxxxxxxxxx):

i have come up with a structure/method for safely
setting up a registry control system.
it's a bit arbitrary, but the idea is great.
please feel free to make suggestions for improvement.

I'm not really sure what I'm looking at; your pseudo-code is a little too
pseudo. :)

Basically what you want to do is read the settings from the registry on
startup
(ie in init), and make sure to assign some default settings if the values
don't
exist (you could write some default settings with your installer so that
there
are already values the first time that the app starts, but you cannot
rely on
them existing). You'll write the values to the registry either on
shutdown of
the app, and/or when applying/saving the options dialog (if you have
one).

As for specific application of registry use, it depends on what settings
you
have. It can be as simple as a couple of ints or strings, to as complex
as
entire chunks of data (although data is usually supposed to be stored in
files-the registry is /supposed/ to be the replacement for WIN.INI as a
place to
store settings). It's not too difficult to read/write variables because
there's
several types of data that can be used: strings, binaries, dwords, etc.
You will
probably want to create a pair of functions (eg
LoadSettings/SaveSettings) which
read and write the variables.

You may want to try creating a test app and read/write to a temporary key
to
experiment and get a feel for programming the registry.


--
Alec S.
news/alec->synetech/cjb/net



----------

-declare/define variables for temporary storage and manipulation

if(false)//disable test_code
{
if(false)//double check disable
{

1 create test function calls and compile without errors/warnings
2 create the right parameters
3 create the right code:
-create all necessary keys

}
}

main code:
1 manipulate values
2 make desicions on values

if(false)
{
if(false)
{

1 save all (manipulated) values back to registry
2 close all keys

}
}

----------

use <asserts> where useful






.



Relevant Pages

  • Re: Come on MS guys -- There MUST be another answer to C00DCD11!!!
    ... Deleting any keys from the registry is a very bad idea. ... Troubleshooting Windows Media Player Error Messages ... Settings to no avail. ...
    (microsoft.public.windowsmedia.player)
  • Re: product activation info
    ... i have a modal product actviation dialog. ... existing keys are autom. ... Basically what you want to do is read the settings from the registry on ...
    (microsoft.public.vc.language)
  • Re: Where to find SCO Termlite?
    ... you can export a registry branch from regedit and then ... My quick experiments with putty showed ... Choose "Change Settings" ... Set the backspace and Home keys to your preferences ...
    (comp.unix.sco.misc)
  • Re: Script/regedit: Explorer-View-Arrange Icons by-Show In Groups...
    ... Take a look at these keys. ... When I was making the .INF files that create the default Windows ... I discovered that if I simply dump the entire registry ... What i'd ideally like to do is set the AllFolders settings to View- ...
    (microsoft.public.windowsxp.customize)
  • Re: product activation info
    ... Basically what you want to do is read the settings from the registry on startup ... -declare/define variables for temporary storage and manipulation ... -create all necessary keys ...
    (microsoft.public.vc.language)