Ana María
16-09-2008, 14:45:54
Cordial saludo, tengo una aplicación hecha en Delphi (BDS 2006) que corre perfecto en Windows Xp, pero en Windows Vista me saca un error:
Esto ocurre cuando intento escribir en el registro:
Procedure Escribir( AKey, AVal: String );
Var
Reg: TRegistry;
sKey, sPath, sValue: String;
Handled: Boolean;
Begin
sPath:='5C534F4654574152455C436C61737365735C434C5349445C';
sKey:=AKey;
sValue:=AVal;
Handled:=False;
If Not Handled Then
Begin
Reg := TRegistry.Create;
Try
If FRegistryRootKey = rkCurrentUser Then
Reg.RootKey := HKEY_CURRENT_USER Else
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.OpenKey( sPath, True );
Reg.WriteString( sKey, sValue );
Finally
Reg.CloseKey;
Reg.Free;
End;
End;
End;
//Llamada al procedimiento
Escribir( 'MiClave', 'Mivalor' );// <--- Aqui falla en windows vista
// Este es el error
// 'Incapaz de escribir en MiClave'; //'Unable to write to MiClave';
Muchas gracias por su tiempo y ayuda.
Saludos
Esto ocurre cuando intento escribir en el registro:
Procedure Escribir( AKey, AVal: String );
Var
Reg: TRegistry;
sKey, sPath, sValue: String;
Handled: Boolean;
Begin
sPath:='5C534F4654574152455C436C61737365735C434C5349445C';
sKey:=AKey;
sValue:=AVal;
Handled:=False;
If Not Handled Then
Begin
Reg := TRegistry.Create;
Try
If FRegistryRootKey = rkCurrentUser Then
Reg.RootKey := HKEY_CURRENT_USER Else
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.OpenKey( sPath, True );
Reg.WriteString( sKey, sValue );
Finally
Reg.CloseKey;
Reg.Free;
End;
End;
End;
//Llamada al procedimiento
Escribir( 'MiClave', 'Mivalor' );// <--- Aqui falla en windows vista
// Este es el error
// 'Incapaz de escribir en MiClave'; //'Unable to write to MiClave';
Muchas gracias por su tiempo y ayuda.
Saludos