Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unable to use WinExec
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00092940
Message ID:
00093054
Vues:
38
>It might be a problem with VFP running the same program twice in the same folder, like trying to use foxuser.dbf exclusive in both instances.
>
>Can you from a desktop shortcut launch the EXE twice without it choking on the second?

Yes.

>Why would the EXE want to spawn itself again? Maybe you need a seperate controller program that is responsible for launching the multiple instances of the app.

The program I wrote needs to run all the time. Every 24 hours it needs to shutdown and reinitialize itself. Since I do not want to start it everyday manually, I thought I could use WinExec, CreateProcess, or ShellExecute to launch to program again before it dies.

Since it seems like I can do it this way, it looks like I need a controller program (like you have said) to do this. I was trying something like this:

DO WHILE MoreToDo
CreateProcess(...)
WaitForSingleObject(Process ID, -1)
CloseHandle(Process ID)
CloseHandle(Thread ID)
ENDDO

When I tried this, it locked up FoxPro.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform