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
Titre:
Unable to use WinExec
Divers
Thread ID:
00092940
Message ID:
00092940
Vues:
108
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
Fil
Voir

Click here to load this message in the networking platform