Board index » delphi » Restrict number of instantiations

Restrict number of instantiations

Hi,

How can I restrict the number of instantiations of my program.  I want
to restrict the number of run time instances of my program.  How, can I
detect how many instances are currently running?

Thank You,
Scott

--
--------------------------------------------------------------
Scott Metzger
Software Engineer
Cambio, Inc. - Managing Your Changing Network
http://www.cambio.com

 

Re:Restrict number of instantiations


Quote
In article <38F1EAC4.1F425...@cambio.com>, Scott Metzger wrote:
> How can I restrict the number of instantiations of my program.  I want
> to restrict the number of run time instances of my program.  How, can I
> detect how many instances are currently running?

Scott,

on the same PC or across a network? On a single PC you could do an
EnumWindows and count the instances of the main form class you find, for
instance. Across a network you would need a kind of licence server setup:
a server program that gets asked by each started instance if its OK to
run (a free licence is available). The started instance would have to
tell the server when it is closed, to free the licences, and it would
also have to report on its health in certain intervals, to allow the
server to reclaim licences for crashed instances or instances running on
PCs the user has just switched off without closing the program or
Windows.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:Restrict number of instantiations


Thanks, that worked like a charm.

Quote
Ioan wrote:
> Try to use this module:

> Ioan

> Scott Metzger <NOSPAMsmetz...@cambio.com> wrote in message
> news:38F1EAC4.1F42553D@cambio.com...
> > Hi,

> > How can I restrict the number of instantiations of my program.  I want
> > to restrict the number of run time instances of my program.  How, can I
> > detect how many instances are currently running?

> > Thank You,
> > Scott

> > --
> > --------------------------------------------------------------
> > Scott Metzger
> > Software Engineer
> > Cambio, Inc. - Managing Your Changing Network
> > http://www.cambio.com

>                    Name: PrevInst.pas
>    PrevInst.pas    Type: Delphi Unit (application/x-unknown-content-type-DelphiUnit)
>                Encoding: x-uuencode

--
--------------------------------------------------------------
Scott Metzger
Software Engineer
Cambio, Inc. - Managing Your Changing Network
http://www.cambio.com

Re:Restrict number of instantiations


For now on the same machine is fine.  Later I may want to add Network
license.  Although, I can see the case where the two machines would be on
separate networks, thus requiring two license managers.

I think it will be sufficient to restrict the number of machines this is
installed on and then restrict the number of instances which can be run on
each machine.

Thanks,
*:> Scott

Quote
"Peter Below (TeamB)" wrote:
> In article <38F1EAC4.1F425...@cambio.com>, Scott Metzger wrote:
> > How can I restrict the number of instantiations of my program.  I want
> > to restrict the number of run time instances of my program.  How, can I
> > detect how many instances are currently running?

> Scott,

> on the same PC or across a network? On a single PC you could do an
> EnumWindows and count the instances of the main form class you find, for
> instance. Across a network you would need a kind of licence server setup:
> a server program that gets asked by each started instance if its OK to
> run (a free licence is available). The started instance would have to
> tell the server when it is closed, to free the licences, and it would
> also have to report on its health in certain intervals, to allow the
> server to reclaim licences for crashed instances or instances running on
> PCs the user has just switched off without closing the program or
> Windows.

> Peter Below (TeamB)  100113.1...@compuserve.com)
> No e-mail responses, please, unless explicitly requested!

--
--------------------------------------------------------------
Scott Metzger
Software Engineer
Cambio, Inc. - Managing Your Changing Network
http://www.cambio.com

Other Threads