trichview.com

trichview.support




Re: ActiveX & to Sergey -- Addition?


Return to index


Author

Message

Sergey Tkachenko

Posted: 08/11/2003 12:47:11


Actions (not only RichViewActions, but any TAction) do not work in ActiveX.

Application has OnIdle method occuring periodically when the application

does nothing. Actions use this method to update their state and to link

themselves to the target control. ActiveX does not have this event, so

actions do not work.


There is a workaround, but I am not sure that it gives stable results.

Create a timer:


procedure TActiveFormX.Timer1Timer(Sender: TObject);

var i: Integer;

begin

  for i := 0 to ComponentCount-1 do

    if Components[i] is TrvAction then

      TrvAction(Components[i]).UpdateTarget(RichViewEdit1);

end;


It's important to disable this timer on closing, otherwise the application

may crash.





Powered by ABC Amber Outlook Express Converter