unit uSetConfig;
interface
uses
SysUtils, uInterface, Windows, Controls, Forms, FSetForm;
type
{ TDllTest }
TIConfig = class(TInterfacedObject, IConfig)
private
FNotic:INotic;
protected
procedure SetNotic(aNotic:INotic); stdcall;
function GetUserInfo(var sID,sPwd:WideString):Boolean;stdcall;
procedure ShowForm(App:THandle;Notice:INotic);stdcall;
public
constructor Create;
destructor Destroy; override;
end;
function CreateDll: IConfig; stdcall; //Dll导出函数
exports
CreateDll;
implementation
function CreateDll: IConfig; stdcall;
begin
Result := TIConfig.Create;
end;
{ TIConfig }
constructor TIConfig.Create;
begin
end;
destructor TIConfig.Destroy;
begin
FNotic := nil;
inherited;
end;
function TIConfig.GetUserInfo(var sID, sPwd: WideString): Boolean;
begin
result := True;
try
TConfig.GetUserInfo(sID,sPwd);
except
result := False;
end;
end;
procedure TIConfig.SetNotic(aNotic: INotic);
begin
FNotic := aNotic;
end;
procedure TIConfig.ShowForm(App: THandle; Notice: INotic);
begin
Application.Handle:=app;
fmSetForm:=TfmSetForm.create(application);
fmSetForm.Notic := Notice;
fmSetForm.ShowModal;
fmSetForm.Free;
end;
end.
DLL 实现单元
最新推荐文章于 2023-08-26 14:58:30 发布