home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue58 / Construc / Unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2000-05-05  |  900 b   |  42 lines

  1. unit Unit1;
  2. interface
  3. uses
  4.   ComObj, ActiveX, AspTlb, TDM58_TLB, StdVcl;
  5.  
  6. type
  7.   TDrBob42 = class(TASPObject, IDrBob42)
  8.   protected
  9.     procedure OnEndPage; safecall;
  10.     procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
  11.     procedure ASProduce; safecall;
  12.   end;
  13.  
  14. implementation
  15. uses
  16.   ComServ, SysUtils;
  17.  
  18. procedure TDrBob42.OnEndPage;
  19. begin
  20.   inherited OnEndPage;
  21. end;
  22.  
  23. procedure TDrBob42.OnStartPage(const AScriptingContext: IUnknown);
  24. begin
  25.   inherited OnStartPage(AScriptingContext);
  26. end;
  27.  
  28. procedure TDrBob42.ASProduce;
  29. var
  30.   UserName: String;
  31. begin
  32.   UserName := Session['UserName'];
  33.   Response.Write('<H1>Hello, '+UserName+'!</H1>');
  34.   Response.Write('<HR>');
  35.   Response.Write('The time is: '+TimeToStr(Now));
  36. end;
  37.  
  38. initialization
  39.   TAutoObjectFactory.Create(ComServer, TDrBob42, Class_DrBob42,
  40.     ciMultiInstance, tmApartment);
  41. end.
  42.