Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop multiple launches of my application 2

Status
Not open for further replies.

JWilsonny

Programmer
May 8, 2001
46
US
How do I stop users from starting multiple sessions of my application on the same work station? FP26
 
The following can be done to acieve what you want.
1. Create a DataBase with name, say MyUsers
2. Have fields for User Name etc.. for each user.
3. When ever a user is in, Open this database and lock the users record. The DBF can be opened in say 50 or so slot with an alais, and remember to leave this file open always. So whenever individual programs open database and closes, remember to close all except this user file. Only Quit from the software shall close this file. What we achieve by this is that the users record remains locked till he logs out.
4. Always check, if the users record is locked already, before locking the record. If it is already locked, it means he has loged in from station already. This is true, even if the user loged in from the same station.
5. Any accidental quit from software automaticaly unlocks the record. So this will not create a problem.

I am using this method successfuly for over 6 or 7 years now in various places.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Ramani is sophisticated, very good.
It is possible try more simple way.
If you have any local table, (if no, create it)
your program may start with
...
on error do is_run
use Localtable excl
on error
...
proc is_run
if error() = 1705
wait "Sorry, application already run"
quit
endif
retu
 
I used DDE....

=ddesetoption("SAFETY",.F.)
ichannel = DDEINITIATE("myapp","ZOOM")
IF ichannel =>0
=DDETERMINATE(ichannel)
QUIT
ENDIF
=DDESETSERVICE("myapp","define")
=DDESETSERVICE("myapp","execute")
=DDESETTOPIC("myapp","","ddezoom")

PROCEDURE ddezoom
PARAMETER ichannel,saction,sitem,sdata,sformat,istatus
ZOOM WINDOW SCREEN NORM
RETURN

has the added advantage that, if the user starts up a second instance the first instance gets maximized.

N
 
Hi nigelgomm,
This is interesting. I have my vote for you. I am using it with little raping of my own.. and I will provide other forum users also have it with my wraps. (Hope you have no objection). Thanks again.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com

LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
There is a program called FOXCHECK.EXE that I have used for quite a long time. If you execute this program using the following syntax:

FOXCHECK.EXE foxapp.exe

in your icon the FOXCHECK program will check to see if another session of FPW26 is open, and if so, notify the user that a session is already in use. It will not start another session. If no other FPW session is in use, the "foxapp.exe" will be executed.

I've used this for a while and it always works. However, it will not prevent others from using FPW 2.6 or runtime if the FOXCHECK program isn't executed first.

If you let me know what your e-mail address is I'll attach a copy of FOXCHECK for you.

Scott Smith
 
JWilsonny, you can simple check your resource file. Put this in you start prg:

IF EMPTY(SYS(2005))
WAIT "YOU START APPLICATION AGAIN" WINDOW NOWAIT
RETURN
ENDIF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top