DLL的静态调用
程序员文章站
2022-06-24 21:56:45
...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//DLL的静态调用
Function MyMax ( X , Y : integer ) : integer ; stdcall ; external 'Project1.dll' ; //第一步:声明函数
procedure TForm1.btn1Click(Sender: TObject);
begin
ShowMessage ( IntToStr(MyMax(30,50)) ) ; //第二步:调用声明函数
end;
end.
上一篇: BTC全方位的行情解读有你关注
下一篇: JAVA调用DLL文件