Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RegOpenKey & RegDeleteKey
Message
 
To
17/02/2003 13:15:09
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00754071
Message ID:
00754178
Views:
34
>Hi Sergey,
>
>I still can't get it to work. What am I missing?
>
>#DEFINE HKEY_LOCAL_MACHINE -2147483646
>#DEFINE ERROR_SUCCESS 0
>
>LOCAL lnOpenHKey, lcOpenKey, lnOpenResult
>STORE "" TO lcOpenKey
>STORE 0 TO lnOpenHKey, lnOpenResult
>
>DECLARE Integer RegOpenKey IN Win32API ;
> INTEGER nHKey, STRING cSubKey, INTEGER @nHandle
>
>lnOpenHKey = HKEY_LOCAL_MACHINE
>lcOpenKey = "System\\CurrentControlSet\\Control\\ComputerName\\ComputerName\\MyNewReg"
>lnSuccess = RegOpenKey(lnOpenHKey, lcOpenKey, @lnOpenResult)
>* Check if there was an ERROR
>IF lnSuccess <> ERROR_SUCCESS
> MESSAGEBOX(TRANS(lnSuccess), 64, "FAILED Open")
> RETURN
>ENDIF
>
>lnSuccess == 87 && This is the value returned.
>
>The key exists. I can see it with "RegEdit" I can open & delete it with "RegEdit" But not in code. I ran the ".prg" from "WestWind" The keys were created. But not deleted. I un-commented Rick's code for the deletion. But it failed.
>
>FYI: VFP 6 SP5 on a Win2000 OS
>
>Thanks for your patience

Mike,

Try
DECLARE Integer RegOpenKey IN Win32API;
  INTEGER nHKey, STRING @cSubKey, INTEGER @nHandle
lnSuccess = RegOpenKey(lnOpenHKey, @lcOpenKey, @lnOpenResult)
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform