Delphi DLL 窗体

2017-05-17 09:44:16来源:oschina作者:vga人点击



Dll导出:
```
{$R *.res}
exports
ShowDataCheckForm;
begin
end.
```
DLL 实现:
```
public
{ Public declarations }
end;
procedure ShowDataCheckForm(app: THandle; CheckStep: Integer); stdcall;var
FormMain: TFormMain;
implementationprocedure ShowDataCheckForm(app: THandle; CheckStep: Integer);
begin
Application.Handle := app;
FormMain := TFormMain.Create(Application);
if CheckStep = 1 then
FormMain.Caption := '参数一'
else
FormMain.Caption := '参数二';
try
FormMain.ShowModal;
finally
FormMain.Free;
end;
end;
```
DLL 调用:
```
procedure ShowDataCheckForm(app: THandle; CheckStep: Integer);
stdcall;
external './dll/YCDataCHK.dll'; // 动态连接库procedure TForm1.btn1Click(Sender: TObject);
begin
ShowDataCheckForm(Application.Handle, 1);
end;
```

最新文章

123

最新摄影

闪念基因

微信扫一扫

第七城市微信公众平台