Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing the Windows 7 Registry
Message
From
06/11/2011 01:57:31
 
 
To
05/11/2011 15:19:10
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01528163
Message ID:
01528173
Views:
61
>I'm having problems getting consistent access to the Windows 7 Windows Registry. I've used the Registry.vcx distributed with VFP 9.0 as well as Codemine's cmRegGetValue function and the WScript.Shell's module. I get different results with each. Each attempt is "successful" meaning that I get a return value of .T. or 0, but the value that gets returned varies. Sometimes, the stored value (a 12-character value) is returned as a 9-character string, sometime as a 10-character string followed by binary (or mixed) garbage.
>
>The attached image shows a couple of examples.
>
>Wonder if anyone's had similar problems and has found a work-around.

So have you actually looked in the registry to determine which method/s return the correct value ?
It may be a 64/32 bit issue - for example for a 32-bit app HKEY_LOCAL_MACHINE/Software is mapped to HKEY_LOCAL_MACHINE/Software/WOW6432Node so the value of what appears to be the same key can be different depending on whether you are running 64 or 32 apps.

Remember that if you want to examine registry values that are used by a 32 bit app then look in the relevant WOW6432Node
Previous
Reply
Map
View

Click here to load this message in the networking platform