📄 importdata.dpr
字号:
library ImportData;
uses
Forms,
Dialogs,
MainOutUnit in '..\..\MainOutUnit.pas',
UnitDataMD in 'UnitDataMD.pas' {DataMd: TDataModule},
UnitMain in 'UnitMain.pas' {FormMain};
var
OldHandle:THandle;
{$R *.res}
procedure DLL_Create(AOwnerHandle:THandle);
begin
OldHandle:=Application.Handle;
DCntString:='';
DCurHUHAO :='';
DCurYHID :=-1;
DCurLSH :='';
DCurSFXH :=-1;
DCurOpID :=-1;
DCurOpName:='';
Application.Handle:=AOwnerHandle;
InitMainOutFun;
end;
procedure DLL_Destory;
begin
Application.Handle:=OldHandle;
end;
procedure DLL_InitDatabase(ConnectionStr,HuHao,LSH,OpName:PChar;YongHuID,ShouFeiXH,OpID:Integer);
begin
DCntString:=ConnectionStr;
DCurHUHAO :=HuHao;
DCurYHID :=YongHuID;
DCurLSH :=LSH;
DCurSFXH :=ShouFeiXH;
DCurOpID :=OpID;
DCurOpName:=OpName;
with DataMD do begin
ADOConnection.ConnectionString:=ConnectionStr;
ADOConnection.Connected:=True;
end;
end;
procedure DLL_Open;
var
FormMain: TFormMain;
begin
FormMain:= TFormMain.Create(Application);
FormMain.ShowModal;
FormMain.Free;
end;
procedure LibraryProc(Reason: Integer);
begin{DLL的初始化和卸载函数}
case Reason of
0:begin
DataMd.Free;
end;
1:begin
DataMd:=TDataMd.Create(Application);
end;
end;
end;
exports
DLL_Create,DLL_Destory,DLL_InitDatabase,DLL_Open;
begin
DLLProc:=@LibraryProc;
DLLProc(1);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -