procedure TMain.FormCreate(Sender: TObject);
begin
TObjFactoryEx.Create([IMainForm,IFormMgr],self);
SetSysSkin(dxSkinController);
if not LoadSysModule then exit;
LoadUserModule;
if not Sys.Login.Login then
begin
Application.ShowMainForm:=False;
Application.Terminate;
end;
Sys.ERPInit.InitSYS;
Sys.ERPInit.InitMenu(dxBarManager);
CloseSplash;
BringToFront;
End;
procedure TTangramModule.UnInstall;
var Reg:IRegistry;
begin
if FModuleCls<>nil then
begin
Reg:=SysService as IRegistry;
FModuleCls.UnRegisterModule(Reg);
end;
end;
TSysService=Class(TObject,IInterface,ISysService)
function TSysService.QueryInterface(const IID: TGUID; out Obj): HResult;
var aFactory:TFactory;
begin
Result:=E_NOINTERFACE;
if self.GetInterface(IID,Obj) then
Result:=S_OK
else begin
aFactory:=FactoryManager.FindFactory(IID);
if Assigned(aFactory) then
begin
aFactory.prepare(FParam);
Result:=aFactory.GetIntf(IID,Obj);
end;
end;
end;