首页 > Windows开发 > 详细

Delphi 调用Dll的两种方式

时间:2016-03-18 00:10:49      阅读:264      评论:0      收藏:0      [点我收藏+]
unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  function RunDllFuc(a,b:Double):Double;cdecl;externalTest_DLL.DLL;//方式一
  function RunDllFuc(a,b:Double):Double;stdcall;externalTest_DLL.DLL;//方式二
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  a,b:Double;
begin
  a:=RunDllFuc(a,b);
end;

end.

该例程在Delphi XE7下通过。

Delphi 调用Dll的两种方式

原文:http://www.cnblogs.com/China3S/p/5289956.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!