K
koy0755
Unregistered / Unconfirmed
GUEST, unregistred user!
源代码如下.只是最简单地实现在向本机发信息.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
function netmessagebuffersend(servernamewidechar;
msgnamewidechar;
formnamewidechar;
bufwidechar;
var buflen:integer):integer;cdecl;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function netmessagebuffersend;external 'netapi32.dll' name 'netmessagebuffersend';
procedure TForm1.Button1Click(Sender: TObject);
var toname:array [0..64] of widechar;
wmsgtext:array [0..1000] of widechar;
msglen,i:integer;
toh,msg:string;
s,sd:integer;
begin
toh:='127.0.0.1';
msg:='sdfadfasdf';
for i:=0 to 64 do toname:=#0;
stringtowidechar(toh,toname,sd);
for i:=0 to 1000 do wmsgtext:=#0;
stringtowidechar(msg,wmsgtext,sd);
s:=netmessagebuffersend(nil,toname,nil,@wmsgtext,msglen);
end;
end.
居然说无法定位程序输入点netmessagebuffersend于动态链接库netapi32.dll上.请问这是怎么回事?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
function netmessagebuffersend(servernamewidechar;
msgnamewidechar;
formnamewidechar;
bufwidechar;
var buflen:integer):integer;cdecl;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function netmessagebuffersend;external 'netapi32.dll' name 'netmessagebuffersend';
procedure TForm1.Button1Click(Sender: TObject);
var toname:array [0..64] of widechar;
wmsgtext:array [0..1000] of widechar;
msglen,i:integer;
toh,msg:string;
s,sd:integer;
begin
toh:='127.0.0.1';
msg:='sdfadfasdf';
for i:=0 to 64 do toname:=#0;
stringtowidechar(toh,toname,sd);
for i:=0 to 1000 do wmsgtext:=#0;
stringtowidechar(msg,wmsgtext,sd);
s:=netmessagebuffersend(nil,toname,nil,@wmsgtext,msglen);
end;
end.
居然说无法定位程序输入点netmessagebuffersend于动态链接库netapi32.dll上.请问这是怎么回事?