home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Doc / COMSERV.INT < prev    next >
Text File  |  1999-08-11  |  2KB  |  65 lines

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