Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Registry Access - VFP Foundation Class
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00311681
Message ID:
00360523
Views:
7
>>>That does help. I modified my code by using your information and it is returning a 0. But how do I get to the key value?
>>
>>If the function is returning a zero, then it means that it succeeded. Here's a code snippet retrieves the resolution width option from the VFP options
SET CLASSLIB TO REGISTRY.VCX ADDITIVE
>>oReg = CREATEOBJECT('Registry')
>>RELEASE CLASSLIB REGISTRY
>>lnvalue = 0
>>lcentry = "ResWidth"
>>lcpath = "Software\Microsoft\VisualFoxPro\6.0\Options"
>>IF oReg.GetKeyValue(lcentry, @lnvalue, lcpath, HKEY_CURRENT_USER) = 0
>>  ? lnvalue
>>ELSE
>>  * Error
>>ENDIF
Note the ampersand. That passes the variable by reference.
>

Nitpick - ampersand is &; that's the @ (at) to force pass by ref in a function or method.

>
>From the line '? lnvalue' it only displays the data if it is string(character). That does not work for dword data. Is there any function to display dword data.

You'd have to rework the class - the API call tells you the registry return type, but the FFC class only handles strings. There are 12 possible variants. You want to look at the RegQueryValue() or RegQueryValueEx() API call in the FFC to modify the behavior.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform