Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to use WinExec
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Unable to use WinExec
Miscellaneous
Thread ID:
00092940
Message ID:
00092940
Views:
107
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!
Next
Reply
Map
View

Click here to load this message in the networking platform