B
beamgx
Unregistered / Unconfirmed
GUEST, unregistred user!
以下代码在98下正常
在2000下出错,错误代码为:35 //在ncb_lana_num域中无效的编号
如何解决?
procedure Tform1.FormCreate(Sender: TObject);
var
ret:UCHAR;
i,x,y:integer;
p:single;
begin
new(ncbRock);
randomize();
i:=0;
FillChar(char_buffer,sizeof(char_buffer),0);
post_add:=@postrout; //取后处理例程的地址
ncbRock.ncb_buffer:=@char_buffer; //取数据缓冲区的地址
InitNCB(ncbRock); //初始化NCB块
ret:=9;
ncbname:=random(100);
ncbRock.ncb_name[1]:=ncbname;
ncbRock.ncb_command:=$30; //加名,同步方式
while ((i<10)and(ret<>0)) do
begin
ret:=byte(netbios(ncbRock));//0为加名成功
i:=i+1;
end;
if ret<>0 then
begin
MessageDlg('错误代码:'+inttostr(ret),mtWarning,[mbOk],0);
end
end;
在2000下出错,错误代码为:35 //在ncb_lana_num域中无效的编号
如何解决?
procedure Tform1.FormCreate(Sender: TObject);
var
ret:UCHAR;
i,x,y:integer;
p:single;
begin
new(ncbRock);
randomize();
i:=0;
FillChar(char_buffer,sizeof(char_buffer),0);
post_add:=@postrout; //取后处理例程的地址
ncbRock.ncb_buffer:=@char_buffer; //取数据缓冲区的地址
InitNCB(ncbRock); //初始化NCB块
ret:=9;
ncbname:=random(100);
ncbRock.ncb_name[1]:=ncbname;
ncbRock.ncb_command:=$30; //加名,同步方式
while ((i<10)and(ret<>0)) do
begin
ret:=byte(netbios(ncbRock));//0为加名成功
i:=i+1;
end;
if ret<>0 then
begin
MessageDlg('错误代码:'+inttostr(ret),mtWarning,[mbOk],0);
end
end;