home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / Runimage / Delphi50 / Demos / Midas / Setparam / servdata.pas < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  1KB  |  57 lines

  1. unit ServData;
  2.  
  3. {
  4.   This is the remote datamodule for this demo.  It contains the implementaion
  5.   of the OLE automation object that the client application talks to.  The
  6.   client project contains the code which calls the SetParams method of the
  7.   IProvider interface.
  8. }
  9.  
  10. interface
  11.  
  12. uses
  13.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  14.   ComServ, ComObj, VCLCom, StdVcl, DataBkr, Serv_TLB, Db, DBTables,
  15.   Provider;
  16.  
  17. type
  18.   TSetParamDemo = class(TRemoteDataModule, ISetParamDemo)
  19.     Events: TQuery;
  20.     EventProvider: TDataSetProvider;
  21.     procedure SetParamDemoCreate(Sender: TObject);
  22.     procedure SetParamDemoDestroy(Sender: TObject);
  23.     procedure EventsAfterOpen(DataSet: TDataSet);
  24.   end;
  25.  
  26. var
  27.   SetParamDemo: TSetParamDemo;
  28.  
  29. implementation
  30.  
  31. {$R *.DFM}
  32.  
  33. uses ServMain;
  34.  
  35. procedure TSetParamDemo.SetParamDemoCreate(Sender: TObject);
  36. begin
  37.   { Update the client counter }
  38.   MainForm.UpdateClientCount(1);
  39. end;
  40.  
  41. procedure TSetParamDemo.SetParamDemoDestroy(Sender: TObject);
  42. begin
  43.   { Update the client counter }
  44.   MainForm.UpdateClientCount(-1);
  45. end;
  46.  
  47. procedure TSetParamDemo.EventsAfterOpen(DataSet: TDataSet);
  48. begin
  49.   { Update the query counter }
  50.   MainForm.IncQueryCount;
  51. end;
  52.  
  53. initialization
  54.   TComponentFactory.Create(ComServer, TSetParamDemo,
  55.     Class_SetParamDemo, ciMultiInstance);
  56. end.
  57.