Cara, só em casos muito específicos temos de dar um addref().

O problema realmente é a mistura de variaveis tipo classe e interface
que vc fez. a variável tem que ser sempre do tipo interface se
trabalhando com interfaces.

var
  vCont: Integer;
  vObj: IESApplicationControlTheme;
begin
  { Faz um loop nos componentes do form }
  for vCont := 0 to Self.ComponentCount -1 do 
    if Supports(Components[vCont], 
      IESApplicationControlTheme, vObj) and Assigned(vObj) then
      vObj.SetTheme(Theme);
end;

muito menos código do que vc imagina não?

Responder a