git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/branches/D2007-DA5@21 0c75b7a4-871f-7646-8a2f-f78d34cc349f
60 lines
1.4 KiB
ObjectPascal
60 lines
1.4 KiB
ObjectPascal
unit uInformeRegistryUtils;
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, Forms, uClassRegistryUtils;
|
|
|
|
type
|
|
IInformeRegistry = interface (IReportRegistry)
|
|
['{F6AC050F-5547-4E1F-AA44-DA0D06EDA4D7}']
|
|
function CreateInforme(const aClassOrDisplayname: String;
|
|
aOwner: TComponent = NIL): TInterfacedObject;
|
|
end;
|
|
|
|
TInformeRegistry = class(TReportRegistry, IInformeRegistry)
|
|
protected
|
|
function CreateInforme(const aClassOrDisplayname: String;
|
|
aOwner: TComponent = nil): TInterfacedObject;
|
|
end;
|
|
|
|
function CreateInforme(const AName: String; const IID: TGUID; out Intf): Boolean;
|
|
|
|
var
|
|
InformeRegistry : IInformeRegistry;
|
|
|
|
implementation
|
|
|
|
uses
|
|
SysUtils, cxControls;
|
|
|
|
function CreateInforme(const AName: String; const IID: TGUID; out Intf): Boolean;
|
|
begin
|
|
ShowHourglassCursor;
|
|
try
|
|
Result := Supports(InformeRegistry.CreateInforme(AName, Application), IID, Intf);
|
|
finally
|
|
HideHourglassCursor;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TInformeRegistry }
|
|
|
|
function TInformeRegistry.CreateInforme(const aClassOrDisplayname: String;
|
|
aOwner: TComponent): TInterfacedObject;
|
|
begin
|
|
if not Assigned(AOwner) then
|
|
AOwner := Application;
|
|
Result := CreateObject( aClassOrDisplayname) as TInterfacedObject;
|
|
end;
|
|
|
|
|
|
initialization
|
|
InformeRegistry := TInformeRegistry.Create;
|
|
|
|
finalization
|
|
InformeRegistry := NIL;
|
|
|
|
end.
|