Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making sure your exe is only running once
Message
De
19/06/2003 18:56:02
Larry Huisingh
Lockheed Martin Information Technology
Richland, Washington, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00798057
Message ID:
00801999
Vues:
22
>>Hi I'm a beginner and I want to know an easy way to make sure your application is only running once and how to implement it Thank you
>
>Check Implementation of the Win32 Event object File #9807. It shows how to use windows Event object to implement single-instance app. Here's another one Re: Only open application once Message #585856. It uses windows Mutex.

Another thing to keep in mind is that if the application is on a network and you don't want any other user to be able to access the app while someone else is using it you'll need to implement a method to have a shared file that has a record that is locked by the first one to run it. The methods mentioned above (I believe) work only if you are trying to prevent multiple instances of an app on the same machine. Preventing it on different machines accessing a common directory is a different problem.

I used the record locking method on one of my apps lately (primarily to keep multiple instances off of one machine) and it's saved me a couple of times from accidentally running an app on two different boxes.
Larry Huisingh
Lockheed Martin Information Technology
Richland WA USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform