home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 October / tst.iso / programs / borland / RUNIMAGE / DELPHI40 / DOC / COMSERV.INT < prev    next >
Encoding:
Text File  |  1998-06-17  |  2.0 KB  |  64 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Runtime Library                  }
  5. {       COM server support                              }
  6. {                                                       }
  7. {       Copyright (C) 1997,98 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 OnLastRelease: TLastReleaseEvent;
  53.   end;
  54.  
  55. var
  56.   ComServer: TComServer;
  57.  
  58. function DllGetClassObject(const CLSID, IID: TGUID; var Obj): HResult; stdcall;
  59. function DllCanUnloadNow: HResult; stdcall;
  60. function DllRegisterServer: HResult; stdcall;
  61. function DllUnregisterServer: HResult; stdcall;
  62.  
  63. implementation
  64.