Skip to content

TBaseSingleInstance

Abstract class for single application instance.

Declaration

Source position: singleinstance.pp line 40

type

  TBaseSingleInstance = class(TComponent)
  public
    constructor Create;
    destructor Destroy;
    function Start : TSingleInstanceStart;
    procedure Stop;
    procedure ServerCheckMessages;
    procedure ClientPostParams;
    property TimeOutMessages: Integer; {rw}
    property TimeOutWaitForInstances: Integer; {rw}
    property OnServerReceivedParams: TSingleInstanceParamsEvent; {rw}
    property StartResult: TSingleInstanceStart; {r}
    property IsServer: Boolean; {r}
    property IsClient: Boolean; {r}
  end;

Description

TBaseSingleInstance is the abstract parent for classes that allow you to control the instances if your application. You must never instantiate TBaseSingleInstance directly, instead, use for example the TAdvancedSingleInstance class.

Properties

Member Visibility Description
IsClient read only public Is this application the client instance ?
IsServer read only public Is this application the server instance ?
StartResult read only public Contains the result of the last Start call.
TimeOutMessages public Timeout when waiting for messages.
TimeOutWaitForInstances public Timeout when trying to contact server instance.
See all Properties

Methods

Member Visibility Description
ClientPostParams public Send parameters to the server.
Create public Create a new instance of the TBaseSingleInstance class.
Destroy public Stop waiting and destroy the instance.
ServerCheckMessages public Check for messages from a client application.
Start public Check if another instance of the application is running.
Stop public Stop the current instance.
See all Methods

Events

Member Visibility Description
OnServerReceivedParams public Event triggered during ServerCheckMessages.
See all Events

Errors

Instantiating and using this class will result in abstract errors.

See also

Name Description
TAdvancedSingleInstance Single Application instance class using file communication.
advancedsingleinstance Implement SingleInstance using files.