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
Miscellaneous
Thread ID:
00092940
Message ID:
00093007
Views:
28
>
>I tried the ShellExecute from my Command window and now that works. But, I still have doubts on whether that will work any better than WinExec or CreateProcess. Do you know of any reason why I would get the error while doing a WinExec or CreateProcess? Does the fact that I compiled the EXE on Windows NT make a difference?
>
>Thanks!

I was able to get another instance of VFP going (running an exe) from the command window with the following:
DECLARE SHORT CreateProcess IN Win32API;
  STRING @lpApplicationName,;
  STRING @lpCommandLine,;
  STRING @lpProcessAttributes,;
  STRING @lpThreadAttributes,;
  STRING bInheritHandles,;
  INTEGER dwCreationFlags,;
  STRING @lpEnvironment,;
  STRING @lpCurrentDirectory,;
  STRING @lpStartupInfo,;
  STRING @lpProcessInformation
* lcfile was the fully qualified executable file name
* lccmndline was the command line
* lcdir was its path
* lcfalse = CHR(0)
* lcStartupInfo, and lcProcessInfo were the same as yours
llresult = CreateProcess(@lcfile, @lccmndline, 0, 0, lcfalse, 0, 0, @lcdir, @lcStartupInfo, @lcProcessInfo)
If you can get this to work, I would suggest filling in some of the members of the STARTUPINFO structure. It'll give you more control.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform