Re: Writing to registry

Tech-Archive recommends: Speed Up your PC by fixing your registry




"Gary Nelson" <gn@xxxxxxxxxx> wrote in message
news:OU7Fd3ZHGHA.3036@xxxxxxxxxxxxxxxxxxxxxxx
> Ralph,
>
> >
> > I agree.
> >
> > One should never ignore the importance of clearly delimiting
> > properties/attributes/options/defaults as to whether they concern the
> > Application-at-large or a specific user.
>
> I thought we were talking about user specific
> 'properties/attributes/options/defaults'
>
> > Lumping them together only causes
> > confusion and trouble down the road - when you attempt to administer,
> > upgrade, or backup the application; when you need to migrate to a
multiple
> > user scenario; or when addressing security issues.
>
> I thought we were talking aboout a multiple user scenario.
>
> > I keep harping on this subject as it one of my biggest pet peeves with
> > OPAs
> > (Other People's Applications). Applications developed by programmers who
> > don't recognize the difference become become a PITA to migrate to a
> > distributed environment.
>
> As far as I know HKLM is for default values for all users on a specific
> machine, and which are read only if we are talking about a limited user.
> HKCU is for user specific settings. Am I missing something here?
>
> Gary
>

At some point all these conversations wander into 'meanings' and specific
scenarios, and perhaps just plain ole preferences. (eg, we could wrangle all
day on whether these items are defaults, properties, or attributes.)

I am uncomfortable with your expression "All Users" - you always have either
TWO separate sets of values - those that a particular User is interested in
and those that the App is interested in. I feel thinking of the latter as
"All Users" will lead one astray. As in this case where you are essentially
duplicating (creating two tables) for the same data. That is just plain
wrong in any scenario. (Dr. Codd must be rolling in his grave. <g>)

Exactly what would go into those two separate arenas - will vary greatly and
certainly wouldn't be cut 'n dry for all situations. For example, since I
use large monitors and tend to tile current working sets, I always build in
saved start-up positions. Apps that don't -tend to annoy me. That is obvious
a 'User' default. However, you might be distributing a corporate utility
that, the powers that be, have decided must always open in the upper right
corner - that would be a 'App' default.

In the same vein one needs to decide if such items need to belong in the
registry or not. [I am in agreement with you considering the Registry, it
isn't as fragile as many would have you believe, but it is a shared resource
and isn't infinite. Good practice is to always avoid a shared resource when
possible.] In my startup scenario above - since such values are read/write
basically only twice (start-up and quit) why use the registery? - a simple
ini file in a common folder will do quite well. Again we need to determine
if \user\Application Data, \Prog~Files\Common Files\, or \Prog~Files\MyApp
would be a better fit.

However, if I had a scenario where I was launching multiple instances of my
app and wanted to manage various 'shared' items uniquely for each (eg, a
default property screen, tab, or dataview) I would likely use the registry
as it is a bit quicker and more flexible during runtime.

It is a subtle shade of grey - but essentially NO the HKLM is NOT for
default values for all users on a specific machine. It is for specific
values for that App on that machine.

-ralph


.



Relevant Pages

  • Re: Writing to registry
    ... and perhaps just plain ole preferences. ... I have found the registry to be very solid and easy to use ... > and those that the App is interested in. ... > wrong in any scenario. ...
    (microsoft.public.vb.general.discussion)
  • Re: Re: Printing
    ... >> this app is required to go to a specific printer. ... Even in the scenario I described, ... should be stored in an INI file or in the registry so it can be ...
    (microsoft.public.vb.winapi)
  • Re: How do I terminate CWinApp application?
    ... needs to load a scenario before it starts. ... app alive until the user says exit is preferable). ... having an additional CView-derived class, and if there was a syntax error, I'd bring up ...
    (microsoft.public.vc.mfc)
  • Re: How to Facilitate and Use Data Protection on DOM (WinCE 6.0)
    ... make sure that your boot registry is set ... In one scenario the Encryption and ... Decryption in my file system filter seems to work fine but the 2nd ...
    (microsoft.public.windowsce.platbuilder)
  • Re: SSL for very simple security need in web service app
    ... There is only a single end point here, a web service ... app that simply takes order info, validates it and applies it to a database. ... this is a common scenario. ... >>> userID ...
    (microsoft.public.dotnet.framework.aspnet.webservices)