OK,我以搞定了。谢谢大家好,下面是我的代码。
=================================
var
Msg:WideString; //消息内容
Addr: WideString; //目的地址
Sor: WideString; //来源地址
err:Integer;
begin
msg := teMsg.Text;
addr := teIP.Text;
sor := teName.Text;
try
TeStatusBar1.Panels[0].Text:='正在发送...';
err:=NetMessageBufferSend(nil, pwidechar(Addr), PWideChar(Sor), PWideChar(Msg), length(msg)*2);
finally
case err of
0:TeStatusBar1.Panels[0].Text:='消息已送到';
2273:TeStatusBar1.Panels[0].Text:='对方关闭了此项功能';
else
TeStatusBar1.Panels[0].Text:='发送错误';
end;
end;