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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running External Programs within VFP

Status
Not open for further replies.

VFP602

Programmer
Jan 23, 2002
41
MP
Hi guys! Anybody who has an idea on how to call external programs within VFP and execute the related parameters or commands of that external program. For example our remote offices are sending weekly sales (dbf) to our main office via PC Anywhere and the main office runs a program to append that extracted DBF to our 'main dbf'. They do this by first, running an old clipper-based program which extracts the sales within a date range specified, and then they double click on a 'Remote File Transfer' shortcut that dials to our main office and thereby start sending the file. What I want is, I want to make this in one program using VFP. I will prompt the user for the date ranges and once they click 'OK', it will invoke PC anywhere to dial and once connected can start sending the file....as easy as that for the user.....I can use 'run' command to invoke PC anywhere but it won't run the shortcut or the automated task for file transfer automatically. I still need to invoke them manually . I've read sometime before about using 'shellexecute' or using foxtools. Anyway, anybody who can give me ideas on this is greatly appreciated. Thanks in advance.
 
I've come accross a previous thread on calling winzip for backup within VFP. As I browse through the replies, I've come accross a link to Mike Lewis Consultants Ltd. web site and has a very good article on using ShellExecute(). My problem is solved. I can call PC anywhere and run whatever task I want. Thank you Mr. Mike Lewis! Keep up the good work and more power!
 
Thanks VFP602!!!
This Mike Lewis Consultants Ltd. web page with free Technical Papers are great. I used ShellExecute() to call Entrust encrypting software in VFP ....
Thank you Mr. Mike Lewis and Thank you VFP602...
 
I use winexec a lot. Example:

declare integer WinExec in win32api string command,integer parm
#define SW_NORMAL 1

=WinExec('myprog myparm',SW_NORMAL)



Mike Pastore

Hats off to (Roy) Harper
 
Whilst ShellExecute() will run Windows applications asynchronastically with a VFP application, there may be occasions when you want the Windows application to complete a specific process before control returns to VFP.

Unzipping files for use with a VFP application might be a typical example - under those circumstances the WinAPI call CreateProcess() is more appropriate and you can put VFP into a 'wait state' until the external process is complete.

ShellExecute() equates to RUN /N ...
CreateProcess() equates to RUN ...

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top