Re: Stop user from installing more than 1 instance

From: Ch Löfberg (ch.lofberg_at_telia.com)
Date: 09/19/04


Date: Sun, 19 Sep 2004 19:23:56 GMT

Hi Rick! and thank you!

I tried your solution to FLOCK() a file which is allready locked. But it
does´nt return .F. A file allready locke can be locked again and again an
FLOCK() returns .T. everytime.

In the help we can read "FLOCK() ...returns false (.F.) if the table or a
record in the table is already locked by another user".

Can you give us an example in code to explain your sugestion.

Best regards
Christina

"Rick Bean" <rgbean@unrealmelange-inc.com> skrev i meddelandet
news:uRxy4ARnEHA.3352@TK2MSFTNGP15.phx.gbl...
Christina,
There are multiple ways - here are a few I've used:
1) Lock a specific temp file and if it can't be locked, then the app is
already running. (FLOCK() is good for this.)
2) Use API calls to see if the main window is already open.
3) Use the mutex API object.

Rick

"Ch Löfberg" <ch.lofberg@telia.com> wrote in message
news:hvJ2d.3525$d5.27072@newsb.telia.net...
> Hi all!
>
> What is the best way to prevent an user to start an run more than one
> instance of a VFP-app?
>
> Best regards
> Christina
>
>



Relevant Pages

  • Re: One instance only - VFP8/SP1
    ... wasn't it Fopeninstead of Flock()? ... > What is the trick to have this solution to work as supposed? ... > Best regards ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Stop user from installing more than 1 instance
    ... if you repeat it in the same session. ... FLOCK a table will succeed. ... > 3) Use the mutex API object. ...
    (microsoft.public.fox.programmer.exchange)
  • One instance only - VFP8/SP1
    ... an app is to try to FLOCKa file which is allready locked by the first ... the second attempt to FLOCK() doesn´t return .F. ... What is the trick to have this solution to work as supposed? ... Best regards ...
    (microsoft.public.fox.programmer.exchange)

Loading