在ActiveX Form添加了一个定时器,想每隔一段时间触发一次事件照着"Delphi编写高精度定时器ActiveX控件"(http://www.comprg.com.cn/detail.asp?hw_id=7258)
一文写的,但到
procedure TMyTimer.TimerEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnTimer;
end;1、中的FEvents.没有在 type library 中添加的OnTimer选项?
2、在type library 删除的属性和事件还是会显示,在pas文件中还是存在?
一文写的,但到
procedure TMyTimer.TimerEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnTimer;
end;1、中的FEvents.没有在 type library 中添加的OnTimer选项?
2、在type library 删除的属性和事件还是会显示,在pas文件中还是存在?
2:在Type Library Editor中删除属性和事件,刷新代码后需手工再删除单元文件中相应的代码
第2点,谢谢
第1点 就是正常if FEvents <> nil then FEvents.OnTimer;
可我输入完FEvents.后没有OnTimer选项?可我在 type library 的事件中添加了OnTimer选项。
而不需要以下操作,
首先在私有段中定义一个TimerEvent 函数。然后在程序Initialize段中让HiResTimer1.OnTimer = TimerEvent;
我用的是delphi7