Information générale
Catégorie:
Fonctions Windows API
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement