请问怎样动态创建TNMUDP控件?急!急!急!(50分)

I

icool

Unregistered / Unconfirmed
GUEST, unregistred user!
我用TNMUDP.Create(nil)方法创建的控件在使用sendbuff过程时提示'Host lookup cancled'
错误,随后就是蓝屏死机。
 
试试
TNMUDP.Create(Application)

-----
http://www.8421.org
 
To:qdyoung
用你的方法试后,结果还是一样。
 
procedure TForm1.BitBtn1Click(Sender: TObject);
var
udp:tnmudp;
a:char;
begin
udp:=TNMUDP.Create(nil);
try
udp.RemoteHost:='127.0.0.1';
udp.RemotePort:=2020;
udp.LocalPort:=2020;
udp.SendBuffer(a,1);
finally
FreeAndNil(udp);
end;
end;
 
用indy的TidUDP控件吧
 
问题我已找到,不是动态创建TNMUDP的原因。
谢谢qdyoung,蛮牛野蛮牛的热心回答.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部