C
catkiller
Unregistered / Unconfirmed
GUEST, unregistred user!
unit UIEMonitor;<br><br>interface<br><br>uses<br> Windows, ActiveX, Classes, ComObj, SHDOCVW, Dialogs, SysUtils, Forms,<br> Messages, Graphics, Controls, StdCtrls,DDEman,ShellAPI, ExtCtrls,Registry,IniFiles,UrlMon;<br><br>type<br> TIEMonitor = class(TComObject, IDispatch, IObjectWithSite)<br> public<br> private<br> protected<br> end;<br><br>const<br> Class_IEMonitor: TGUID = '{A2765F19-26D9-4729-9BA2-930DC9DE2287}';<br><br>var<br> RUNTIMER:TTimer;<br><br>implementation<br><br>uses ComServ;<br><br>procedure ShowAD;<br>begin<br> RUNTIMER.Enabled := false;<br> ShellExecute(null,nil,PChar('http://www.sina.com'),nil,nil,SW_SHOWNORMAL);<br> RUNTIMER.Enabled := true;<br>end;<br><br>procedure init;<br>begin<br> RUNTIMER := TTimer.Create(nil);<br> RUNTIMER.Enabled:=false;<br> RUNTIMER.Interval := 60*1000;<br> RUNTIMER.OnTimer := ShowAD ;(这行报错)<br> RUNTIMER.Enabled:=true;<br>end;<br><br>initialization<br> TComObjectFactory.Create(ComServer, TIEMonitor, Class_IEMonitor,<br> 'IEMonitor', '', ciMultiInstance, tmApartment);<br>end.<br><br><br>为何RUNTIMER.OnTimer := ShowAD ;这行不行???报错“method pointer and regular procedure”