home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / Runimage / Delphi50 / Demos / Midas / Empedit / servdata.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  1.5 KB  |  59 lines

  1. unit ServData;
  2.  
  3. { This Datamodule is the CoClass for the IEmpServer interface.  It was
  4.   created using the File | New | Remote Data Module menu option }
  5.  
  6. interface
  7.  
  8. uses
  9.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  10.   ComServ, ComObj, VCLCom, StdVcl, DataBkr, Provider, Db, DBTables,
  11.   Serv_TLB;
  12.  
  13. type
  14.  
  15.   TEmpServer = class(TRemoteDataModule, IEmpServer)
  16.     EmpQuery: TQuery;
  17.     EmpQueryProvider: TDataSetProvider;
  18.     procedure EmpQueryAfterOpen(DataSet: TDataSet);
  19.     procedure EmpServerCreate(Sender: TObject);
  20.     procedure EmpServerDestroy(Sender: TObject);
  21.   end;
  22.  
  23. var
  24.   EmpServer: TEmpServer;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. uses ServMain;
  31.  
  32. { This rest of this code just demonstrates how you might monitor client
  33.   activity from the server.  None of this is required to develop an
  34.   application server. }
  35.  
  36. procedure TEmpServer.EmpQueryAfterOpen(DataSet: TDataSet);
  37. begin
  38.   { Update the query counter }
  39.   MainForm.IncQueryCount;
  40. end;
  41.  
  42. procedure TEmpServer.EmpServerCreate(Sender: TObject);
  43. begin
  44.   { Update the client counter }
  45.   MainForm.UpdateClientCount(1);
  46. end;
  47.  
  48. procedure TEmpServer.EmpServerDestroy(Sender: TObject);
  49. begin
  50.   { Update the client counter }
  51.   MainForm.UpdateClientCount(-1);
  52. end;
  53.  
  54. initialization
  55.  { This creates the class factory for us.  This code is generated automatically }
  56.   TComponentFactory.Create(ComServer, TEmpServer, Class_EmpServer,
  57.     ciMultiInstance);
  58. end.
  59.