Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find multiple runs of VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00416289
Message ID:
00416374
Vues:
28
>I am using the following function to see if VFP is already open. If it is I want to use set resource to another foxuser.dbf in another location. Problem is, it always thinks it is the first and trys to use the resource file already open and an error is generated.
>How can I make it see that it is already open.
>

You could use the GETOBJECT() function - if it fails, then it wasn't already open. The GETOBJECT() will throw an "Operation unavailable" error if VFP is not already started.

e.g., from a one file app I have tested this with..
LOCAL loVFP, llErr
ON ERROR llErr = .T.
loVFP = GETOBJECT(,"VisualFoxPro.Application")
IF !llErr
   MESSAGEBOX("VFP started.")
ELSE
   MESSAGEBOX("VFP not started.")
ENDIF
ON ERROR
RELE ALL
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform