TVsppCommInit=function(Ip
char;nPort
word;SpId
char;key
word)
word;stdcall;
PVsppCommInit=^TVsppCommInit;
var
Handle:THandle;
VsppCommInit_num:TVsppcommInit;
VsppCommInit_Add:^TVsppCommInit;
Dll_path:string;
begin
statusbar1.Panels[1].Text:='Á¬½ÓÍø¹Ø³É¹¦!';
memo1.Lines.Add('Á¬½ÓÍø¹Ø³É¹¦');
Dll_path:=extractfilepath(application.ExeName)+'SpServer.dll';
Handle:=Loadlibrary(Pchar(Dll_Path));
if Handle<>0 then
begin
@VsppCommInit_num:=GetProcAddress(Handle,'VsppCommInit');
VsppCommInit_Add:=@VsppCommInit_num;
if VsppCommInit_Add<>nil then
VsppCommInit_num(Pchar(Client_record.Ip),Client_record.Port,Pchar(Client_record.SpId),Client_record.MD5)
else
statusbar1.Panels[0].Text:='°ó¶¨Ê§°Ü!';
end
else
showmessage('µ÷ÓÃ.Dll¿âʧ°Ü!');
Freelibrary(Handle);
不能调用时边的api函数.即VsppCommInit_Add=nil 值.
搞了大半天了,晕死了。。
我自己在delphi 做了个动态链接库. 能正常调用. 哪位大侠帮我指点呐.