T tanminr Unregistered / Unconfirmed GUEST, unregistred user! 2003-08-15 #1 由于在控制台程序中写了一个方法,需要用到NMHTTP组建,是动态创建的! 可是要添加NMHTTP组建的事件,该如何添加! 由于控制台程序中没有窗体对象,好象不能直接赋个PROCEDURE
C creation-zy Unregistered / Unconfirmed GUEST, unregistred user! 2003-08-15 #2 用一个类包装一下就可以了 type TPacket=class procedure NMHTTP1Connect(Sender: TObject); end; procedure TPacket.NMHTTP1Connect(Sender: TObject); begin //your code here... end; var Packet:TPacket; begin Packet:=TPacket.Create; MyNMHTTP.OnConnect:=Packet.NMHTTP1Connect; Packet.Free; end;
用一个类包装一下就可以了 type TPacket=class procedure NMHTTP1Connect(Sender: TObject); end; procedure TPacket.NMHTTP1Connect(Sender: TObject); begin //your code here... end; var Packet:TPacket; begin Packet:=TPacket.Create; MyNMHTTP.OnConnect:=Packet.NMHTTP1Connect; Packet.Free; end;