var
FormMain: TFormMain;
LibHandle: HModule;
procedure LoadModule(AModuleName: String);
implementation
{$R *.DFM}
procedure LoadModule(AModuleName: String);
var
CallModule: TCallModule;
begin
LibHandle := LoadLibrary(PChar(AModuleName));
if LibHandle = 0 then Exit;
@CallModule := GetProcAddress(LibHandle,'CallModule');
if @CallModule <> nil then
CallModule();
end;
procedure TFormMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
var
iCount: Integer;
begin
if MessageDLG('是否退出?',mtConfirmation,[mbYes,mbNO],0) = mrYes then
begin
for iCount := 0 to MDIChildCount - 1 do
MDIChildren[iCount].Close;
CanClose := True;
if not (LibHandle = 0) then
FreeLibrary(LibHandle);
end else
CanClose := False;
end;