Re: Dialog size in pixel

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In a couple situations, the algorithm is
Read the Registry from HKCU
if that fails, read the Registry from HKLM
if that fails, use the hardwired default

This allows the sysadmin to set up "standard defaults" during installation but allows the
user to override them.

My Registry classes, for example, have options like
RegistryInt whatever(IDS_REGISTRY_WHATEVER);
whatever.load(0);

where 0 is the default value to be used.
joe

On Fri, 27 Jun 2008 10:19:05 -0500, "Doug Harrison [MVP]" <dsh@xxxxxxxx> wrote:

On Thu, 26 Jun 2008 22:01:27 -0400, Joseph M. Newcomer
<newcomer@xxxxxxxxxxxx> wrote:

For something like configuration state, it should be treated like the Registry; according
to the latest standards I've seen, a program must be robust and assume that any key inthe
registry can be removed at any time, arbitrarily, including the entire subtree for the
application. The rule was that "no program shall have its installer create registry
entries that cannot be re-created by the execution of the program" or some such phrase.

In one program I had, we needed to have the path to the DLL for an explicit LoadLibrary
call. This was because we were sharing a DLL with a third-party application. I had a
cached copy in the Registry, and the recovery process went like this:

Use the Registry key value
If that fails, check to see if the product is installed
If the product is installed, try loading from its execution directory
If that fails, prompt the user
Unable to locate the required
"c:\...full path here...\whatever.dll"
Do you want to search for it
[Yes] [No]
If the user selects Yes, pop up a file-open box
If the user selects No, abort the command that needed the DLL

That is, the program was prepared to re-create its entire Registry key from the ground up,
for any value. Those values which represented user options were easy; there were many
options dialogs available. But those that could not be represented by an explicit dialog
had recovery dialogs like the one above.

Obviously this does not work for .pst files and other such critical files, but for
configuration data, you have to assume at any point that the file has been deleted and be
prepared to reconstruct it.
joe

Yep, that's good common sense. My registry "read" functions all take
default arguments and return them when the registry value is missing, and
the "save settings" functions recreate the registry hierarchy as necessary.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Word not opening my file
    ... It sounds like the DLL for the Office Plug-in is still be registered. ... Microsoft Office MVP ... this which was par t of Office SP3 and on installation, ... i even did the registry thing it suggested ...
    (microsoft.public.word.application.errors)
  • Re: Ending the DLL Hell myth......
    ... > the Registry also describes the objects full interface. ... > be assummed that DLL 1.0 in one location doesn't have exactly the same ... This would at least prevent the second dll to be deinstall too, ... simply added to an existing Windows installation. ...
    (microsoft.public.dotnet.general)
  • Re: Windows Desktop Search tool
    ... something has registered a .DLL in the registry during its installation. ... Some time ago I downloaded and installed Windows Desktop Search tool (was ...
    (microsoft.public.windowsxp.perform_maintain)
  • RE: WinXP-SP2 fails because cant change Registry SSDPSRV
    ... Permissions and manual changing this registry entry, but it fails every time. ... First make sure your machine is clean from malware and viruses then try the ... "Access Denied" error when trying to install SP2 ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: registry entry or file
    ... I want to create INI file that will be used by my dll. ... Either make registry entry specific to my ... I have to either run installation program once and make ... >>an entry to registry or simply copy the file. ...
    (microsoft.public.win32.programmer.ui)