猪猪编程:WebService开发实例3-Delphi调用DLL
(2010-12-07 13:28:57)
标签:
it |
分类: 计算机 |
procedure TForm2.Button1Click(Sender: TObject);
type TIntFunc =
function(pes_no,password:String):integer;stdcall;
var
handle:Thandle;
Tf:TIntFunc;
Tp:TFarProc;
i:integer;
begin
handle := LoadLibrary(PChar('sLogin.dll'));
{装载DLL}
if handle>0 then
try
Tp := GetProcAddress(handle,PChar('shulib_Login'));
if Tp<>nil
then
begin
Tf := TIntFunc(Tp);
i:=Tf(Trim(Edit1.Text),Trim(Edit2.Text)); {调用函数}
ShowMessage(IntToStr(i)) ;
end
else
ShowMessage('函数没有找到');
finally
FreeLibrary(handle); {释放DLL}
end
else
ShowMessage('dll没有找到');
end;
type
var
begin
else
end;