注册 登录
编程论坛 Delphi论坛

[求助]编译通不过

potato182 发布于 2006-08-17 17:12, 503 次点击

procedure TForm1.gethostbynameClick(Sender: TObject);
var
cr:string;
err:integer;
host:hostent;
op:pchar;
begin
host:=gethostbyname(pchar(edit1.Text));
except
if host=NIL then
begin
edit2.Text:='host does not exit';
exit;
end;
cr:=copy('host.h_addr',4,0 );
edit3.Text:=format('%d.%d.%d.%d',[ord(cr[1]),ord(cr[2]),ord(cr[3]),ord(cr[4])]);
edit2.Text:=host.h_name;


end;
其中host:=gethostbyname(pchar(edit1.Text));
这句编译通不过,大家来看看出了什么问题了,谢谢啊.

2 回复
#2
xu20002006-08-19 22:03
用一个变量替换edit1.text.
#3
yby2006-08-25 22:47
下面应该有错误提示啊
1