home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Database / ejemplos / CORBA16 / serv2.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-09-28  |  1.3 KB  |  60 lines

  1. unit serv2;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ComObj, VCLCom, StdVcl, BdeProv, DataBkr, CorbaRdm, CorbaObj,
  8.   miserv_TLB, Db, DBTables;
  9.  
  10. type
  11.  
  12.   TTMIAPLICACION = class(TCorbaDataModule, ITMIAPLICACION)
  13.     DataSource1: TDataSource;
  14.     Table1: TTable;
  15.     Table2: TTable;
  16.     procedure TMIAPLICACIONCreate(Sender: TObject);
  17.     procedure TMIAPLICACIONDestroy(Sender: TObject);
  18.   private
  19.     { Private declarations }
  20.   public
  21.     { Public declarations }
  22.   protected
  23.     function Get_Table1: IProvider; safecall;
  24.     function Get_Query1: IProvider; safecall;
  25.   end;
  26.  
  27. var
  28.   TMIAPLICACION: TTMIAPLICACION;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. uses CorbInit, CorbaVcl, serv1;
  35.  
  36. function TTMIAPLICACION.Get_Table1: IProvider;
  37. begin
  38.   Result := Table1.Provider;
  39. end;
  40.  
  41. procedure TTMIAPLICACION.TMIAPLICACIONCreate(Sender: TObject);
  42. begin
  43.   MiServidor.UpdateClientCount(1);
  44. end;
  45.  
  46. procedure TTMIAPLICACION.TMIAPLICACIONDestroy(Sender: TObject);
  47. begin
  48.   Miservidor.UpdateClientCount(-1);
  49. end;
  50.  
  51. function TTMIAPLICACION.Get_Query1: IProvider;
  52. begin
  53.  
  54. end;
  55.  
  56. initialization
  57.   TCorbaVclComponentFactory.Create('TMIAPLICACIONFactory', 'TMIAPLICACION', 'IDL:miserv/TMIAPLICACIONFactory:1.0', ITMIAPLICACION,
  58.     TTMIAPLICACION, iMultiInstance, tmMultiThreaded);
  59. end.
  60.