Re: product activation info
- From: "Starglider 4 \(Marco Knoester\)" <rebel-6-out@xxxxxxxxx>
- Date: Sun, 18 Jan 2009 22:51:20 +0100
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
.
- References:
- product activation info
- From: Starglider 4 \(Marco Knoester\)
- Re: product activation info
- From: Norman Bullen
- Re: product activation info
- From: Starglider 4 \(Marco Knoester\)
- Re: product activation info
- From: Pavel A.
- Re: product activation info
- From: Starglider 4 \(Marco Knoester\)
- Re: product activation info
- From: Pavel A.
- Re: product activation info
- From: Starglider 4 \(Marco Knoester\)
- Re: product activation info
- From: Alec S.
- Re: product activation info
- From: Starglider 4 \(Marco Knoester\)
- product activation info
- Prev by Date: Re: Strange file not found exception
- Next by Date: Re: BYTE
- Previous by thread: Re: product activation info
- Next by thread: Re: Viewing the padded bytes
- Index(es):
Relevant Pages
|