Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting certain subkeys - how?
Message
From
14/05/2002 14:45:20
 
 
To
13/05/2002 13:01:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00655754
Message ID:
00656396
Views:
15
>Hello All
>
>
>I am trying to delete certain subkeys from given key but it seems like Deletekey API function always return me 2
>
>Here is what I am trying to do:
>
>dimension laopt(1)
>lnRet=oreg.Enumoptions(@laopt,"Software\My keys\",HKEY_LOCAL_MACHINE,.f.)
>lnCount=alen(laopt,1)
>=oreg.openkey("Software\My keys\",HKEY_LOCAL_MACHINE)
>lnH=oreg.nCurrentkey
>FOR m.i = 1 TO lncount
> lnREt=oreg.DeleteKey(lnH,laopt(i,1))
>ENDFOR &&* m.i = 1 TO lncount
>
>
>What is wrong with the code above? I am using registry.prg taken from UT
>
>TIA

Hi,
The use of oreg.DeleteKey is to delete the "key" not the "key value".
Try this
FOR m.i = 1 TO lncount
     lnRet = RegDeleteValue(lnH,laopt(i,1))
ENDFOR &&* m.i = 1 TO lncount
oreg.DeleteKey(oReg.nUserKey, "Software\My keys\")
HTH
Herman
Previous
Reply
Map
View

Click here to load this message in the networking platform