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

  1. unit ServMain;
  2.  
  3. { This is "Application Server" for this demo.  You must compile and run
  4.   this program once before running the client application.  The remote
  5.   data module (ServData) implments the actual OLE server that the client
  6.   communicates with. }
  7.  
  8. interface
  9.  
  10. uses
  11.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  12.   ExtCtrls, StdCtrls, Grids, DBGrids, Db;
  13.  
  14. type
  15.   TMainForm = class(TForm)
  16.     Panel1: TPanel;
  17.     QueryCount: TLabel;
  18.     ClientCount: TLabel;
  19.   private
  20.     FQueryCount: Integer;
  21.     FClientCount: Integer;
  22.   public
  23.     procedure UpdateClientCount(Incr: Integer);
  24.     procedure IncQueryCount;
  25.   end;
  26.  
  27. var
  28.   MainForm: TMainForm;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. { These procedures update the display of the application server to show
  35.   how many clients are connected and how many queries have been exectued. }
  36.  
  37. procedure TMainForm.UpdateClientCount(Incr: Integer);
  38. begin
  39.   FClientCount := FClientCount + Incr;
  40.   ClientCount.Caption := IntToStr(FClientCount);
  41. end;
  42.  
  43. procedure TMainForm.IncQueryCount;
  44. begin
  45.   Inc(FQueryCount);
  46.   QueryCount.Caption := IntToStr(FQueryCount);
  47. end;
  48.  
  49.  
  50. end.
  51.