加载中…
个人资料
小胖和猪猪
小胖和猪猪
  • 博客等级:
  • 博客积分:0
  • 博客访问:97,578
  • 关注人气:111
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

猪猪编程: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;

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有