Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question related to "dos command problem", thread 184-466983

Status
Not open for further replies.

dduva

Programmer
May 16, 2001
38
US
I am using the ShellExecute command to run a self extracting executable. When the executable is finished another folder is created with the same name as the executable with a couple of text files inside. I am then trying to append these text files to a foxpro table. The problem is that when I use the append command right after the ShellExecute it says the directory just created does not exist.
But if I run the ShellExecute in one foxpro program. Then run another program the append works just fine. What am I doing wrong?

Thanks.
 
Dduva

I've had a similar problem and I solved it by inserting an artificial delay (maybe a WAIT) or something. The problem was that VFP continues running the next line of code after the ShellExecute. By the time the next line executes, the program (commands) executed by ShellExecute hasn't finished yet. So give the ShellExecute a second or two before going to the next line of code in your program. I do not know how that works in Foxpro. In other words, windows uses its multitasking capabilities, puts the program to work on the background and resumes your program.

I hope that helps.

Rianeiro
 
Rianeiro,

I had tried a counter and it was not working. But after reading your post about multitasking I tried increasing the counter and it worked. Thanks.

 
dduva

See HOWTO: Determine When a 32-bit Process has Completed, for an explanation of how use CreateProcess().

This should resolve your problem - should you need to know how to run that process hidden, post again.
FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top