Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know if an instance is running ?
Message
 
À
25/08/2004 08:41:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00936266
Message ID:
00936323
Vues:
12
When your application starts up, try this:
IF FILE("myfile.chk")

  lnTemp = FOPEN("myfile.chk")

  IF lnTemp < 0

    ** If here, another instance has this file locked, so the
    ** application is already running

  ELSE
  
    ** If here, no other instance is running, so store the file
    ** handle for later use
    PUBLIC gnHandle
    gnHandle = lnTemp

  ENDIF

ELSE

  ** No other instance is running
  PUBLIC gnHandle
  gnHandle = FCREATE("myfile.chk")

ENDIF
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform