home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / Runimage / Delphi50 / Source / Rtl / Corba / comcorba.pas next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  1.6 KB  |  55 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Runtime Library                  }
  5. {                                                       }
  6. {       Copyright (C) 1999 Inprise Corporation          }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit ComCorba;
  11.  
  12. interface
  13.  
  14. uses SysUtils, ORBPAS, ComObj, CorbaObj;
  15.  
  16. type
  17.   TCorbaComObjectFactory = class(TCorbaFactory)
  18.   private
  19.     FImplementationClass: TComClass;
  20.   protected
  21.     function CreateInterface(const InstanceName: string): IObject; override;
  22.   public
  23.     constructor Create(const InterfaceName, InstanceName, RepositoryId: string;
  24.       const ImplGUID: TGUID; ImplementationClass: TComClass;
  25.       Instancing: TCorbaInstancing = iMultiInstance;
  26.       ThreadModel: TCorbaThreadModel = tmSingleThread);
  27.     property ImplementationClass: TComClass read FImplementationClass;
  28.   end;
  29.  
  30. implementation
  31.  
  32. uses ActiveX;
  33.  
  34. { TCorbaComOjectFactory }
  35.  
  36. constructor TCorbaComObjectFactory.Create(const InterfaceName, InstanceName,
  37.   RepositoryId: string; const ImplGUID: TGUID;
  38.   ImplementationClass: TComClass;
  39.   Instancing: TCorbaInstancing; ThreadModel: TCorbaThreadModel);
  40. begin
  41.   inherited Create(InterfaceName, InstanceName, RepositoryID, ImplGUID,
  42.     Instancing, ThreadModel);
  43.   FImplementationClass := ImplementationClass;
  44. end;
  45.  
  46. function TCorbaComObjectFactory.CreateInterface(const InstanceName: string): IObject;
  47. begin
  48.   Result := FImplementationClass.Create;
  49. end;
  50.  
  51. initialization
  52.   CoInitialize(nil);
  53.   
  54. end.
  55.