Ver Mensaje Individual
  #10  
Antiguo 17-12-2009
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.281
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Hola.
Añade TAG's al código para que se lea mejor.

El problema es que esos dos códigos no son equivalentes, ya que en el segundo:
Código Delphi [-]
  TAction(MnCuentas).Execute;

MnCuentas no es el nombre del componente, sino el componente en sí.

Vamos por partes (como dijo Jack el destripador...)

Coloca el siguiente código:

Código Delphi [-]
var
  Str:string;
  comp:TComponent;
begin

  // Extraer el nombre
  Str := FUsuarios.QMenuNombreObjeto.Value;
  MessageDlg('Nombre la la Action: ' + Str, mtInformation, [mbOK], 0);

  Str := FUsuarios.QMenuNombreObjeto.AsString;
  MessageDlg('Nombre la la Action (string): ' + Str, mtInformation, [mbOK], 0);

  // Buscar la Taction
  comp := FindComponent(Str);
  // encontrado
  if Assigned(Comp) then begin
    MessageDlg('Encontrado el componente: ' + Str, mtInformation, [mbOK], 0);
    if (comp is TAction) then begin
      // encontrada la TAction
      TAction(comp).Execute;
    end;
  end
  else begin
    MessageDlg('No encontrado el componente: ' + Str, mtWarning, [mbOK], 0);
  end;

Ejecútalo, paso a paso, si hace falta y dinos qué mensajes te salen...
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita