关于dll的一个小问题!(在线等)

fleabug 2003-09-07 10:37:41
//以下是我的源码!

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
e3: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
procedure mun(var x,y,mxn:integer);Stdcall;
external 'min.dll';

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
x,y,z:integer;
begin
x:=strtoint(edit1.Text);
y:=strtoint(edit2.Text);
mun(x,y,z);
e3.Text:=inttostr(z);
end;
//dll 源码
library min;
uses
SysUtils,
Classes;

{$R *.res}
procedure mun(x,y,mxn:integer);stdcall;
begin
if x<y then mxn:=y
else mxn:=x;
end;
exports
mun;
begin
end.
...全文
27 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yurenjf 2003-09-08
  • 打赏
  • 举报
回复
fuction mun( x,y :integer): integer;stdcall;
begin
if x<y then return y
else return x;
end;
fleabug 2003-09-07
  • 打赏
  • 举报
回复
天外流星:
不对,dll是能连接,但是结果不对!e3.text的值为一个八位数值!
outer2000 2003-09-07
  • 打赏
  • 举报
回复
procedure mun(//VAR x,y,mxn:integer);stdcall;
begin
if x<y then mxn:=y
else mxn:=x;
end;
exports
mun;
begin

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧