I successfully create a new key and write a value to it. I cannot get to delete the values or the key itself. My code is
<code>
with TRegistry.Create do
try
Val := TStringList.Create;
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('SOFTWARE\VotAfr\', True) then
begin
GetValueNames(Val);
for i := 0 to Val.Count-1 do
DeleteKey(ReadString('VotAfr'));
end
else
ShowMessage('Error opening key');
finally
Free;
Val.Free;
end;
</code>
This code runs withot errors and the value/s read are also correct - but it does not ger deleted. Someone pse tell me why?
Hannes
<code>
with TRegistry.Create do
try
Val := TStringList.Create;
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('SOFTWARE\VotAfr\', True) then
begin
GetValueNames(Val);
for i := 0 to Val.Count-1 do
DeleteKey(ReadString('VotAfr'));
end
else
ShowMessage('Error opening key');
finally
Free;
Val.Free;
end;
</code>
This code runs withot errors and the value/s read are also correct - but it does not ger deleted. Someone pse tell me why?
Hannes