Information générale
Catégorie:
Fonctions Windows API
Titre:
Unable to use WinExec
I need to launch another instance of the EXE currently running. This is what I have tried:
* Hall Monitor EXE and Location
lcHallMon = SYS(16, 0) + SPACE(1) + This.cLocationCode + SPACE(1) + This.cRoom
* Lanch Hall Monitor again
x = WinExec(lcHallMon, 1)
The variable "x" returns zero. MSDN help says that "the system is out of memory or resources".
OK, so I thought I would try CreateProcess instead. Here is the code:
lcStartupInfo = CHR(65) + REPLICATE(CHR(0), 64)
lcProcessInfo = SPACE(16)
x = CreateProcess(0, lcHallMon, 0, 0, 0, 0, "", 0, @lcStartupInfo, @lcProcessInfo)
The variable "x" returns zero, and GetLastError() returns 32. MSDN help says that "the process cannot access the file because it is being used by another process".
Can someone tell me what I am doing wrong? The above errors occurred when running from Windows 95. The only application running when the error occurs is the FoxPro EXE. The funny thing is that it works from a Windows NT 4.0 workstation.
Thanks in advance for your help!
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