home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 August / VPR9708A.ISO / D3TRIAL / INSTALL / DATA.Z / COMSERV.INT < prev    next >
Text File  |  1997-03-21  |  2KB  |  61 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Runtime Library                          }
  5. {                                                       }
  6. {       Copyright (C) 1997 Borland International        }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit ComServ;
  11.  
  12. {$DENYPACKAGEUNIT}
  13.  
  14. interface
  15.  
  16. uses Windows, ActiveX, SysUtils, ComObj;
  17.  
  18. type
  19.  
  20. { Application start mode }
  21.  
  22.   TStartMode = (smStandalone, smAutomation, smRegServer, smUnregServer);
  23.  
  24. { Class manager event types }
  25.  
  26.   TLastReleaseEvent = procedure(var Shutdown: Boolean) of object;
  27.  
  28. { TComServer }
  29.  
  30.   TComServer = class(TComServerObject)
  31.   protected
  32.     function CountObject(Created: Boolean): Integer; override;
  33.     function CountFactory(Created: Boolean): Integer; override;
  34.     function GetHelpFileName: string; override;
  35.     function GetServerFileName: string; override;
  36.     function GetServerKey: string; override;
  37.     function GetServerName: string; override;
  38.     function GetTypeLib: ITypeLib; override;
  39.   public
  40.     constructor Create;
  41.     destructor Destroy; override;
  42.     procedure Initialize;
  43.     procedure LoadTypeLib;
  44.     procedure SetServerName(const Name: string);
  45.     procedure UpdateRegistry(Register: Boolean);
  46.     property IsInprocServer: Boolean;
  47.     property ObjectCount: Integer;
  48.     property StartMode: TStartMode;
  49.     property OnLastRelease: TLastReleaseEvent;
  50.   end;
  51.  
  52. var
  53.   ComServer: TComServer;
  54.  
  55. function DllGetClassObject(const CLSID, IID: TGUID; var Obj): HResult; stdcall;
  56. function DllCanUnloadNow: HResult; stdcall;
  57. function DllRegisterServer: HResult; stdcall;
  58. function DllUnregisterServer: HResult; stdcall;
  59.  
  60. implementation
  61.