Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting multiple instances of FPD26
Message
De
10/09/1999 22:56:23
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00263532
Message ID:
00263597
Vues:
26
>I am running FPD26 under Win98 with no problems. Is there a way to have FPD26 detect whether a previous instance of the program is running?
>Thanks for your help.

You obviously can't use any of the Win32 API calls, since it's DOS. One trick I've used in the past is to use FCREATE to open a file for low-level I/O in a fixed, known location; if it returns a -1, then either it's already opened by someone, or you don't have the necessary rights to create a file where you've specified (ie you tried writing to a CD, or a network drive where you only have read permissions.

Leave the file open as long as the app is running; when FPDOS exits, it'll close the file and the next FPDOS session will be able to do the FCREATE


>SFried
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform