Ver Mensaje Individual
  #1  
Antiguo 16-09-2008
Avatar de Ana María
Ana María Ana María is offline
Miembro
 
Registrado: ago 2008
Posts: 40
Reputación: 0
Ana María Va por buen camino
Wink Error al escribir en el Registro en Windows Vista

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:

Código Delphi [-]
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
Responder Con Cita