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

Running Another VFP7 EXE From My VFP7 EXE with params 1

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
Hi,

I have an existintg EXE that needs to launch another EXE that does client scheduling. 1) How do I launch the EXE from mine? When the client has been scheduled, I'd like to pass the appointment date and time from the scheduling EXE back to my original EXE. Anyone have suggestions - any light you can spread on the topic would be appreciated.

Thanks,

Dave

The 2nd mouse gets the cheese.
 
Write out a text file with your variables, use a shellexecute() on the 2nd exe which would pick up the text file and aquire the variables.

Brian
 
Hi Again,

Actually, I need to pass a first name, lastname, & a case number to the "scheduling" exe and return the appointment date and time back to my exe.

Thankls,

Dave

The 2nd mouse gets the cheese.
 



Below code will call the app.
shellexecute(2,"open",ExePath,'',sys(2023),1)

If creating a text file will not work for you; you could create a table to hold the data. Then just open the table from the exe.
 
Hi Dave,

I don't think you need shellexecute here. You can just say:

DO myprog2.exe WITH parameter1, parameter2.....

Store the results in some external file, as suggested.

Jim

 
I placed the following lines of code into the control's click event (in the first EXE) that calls the other EXE.

PUBLIC TF_str
*
DO C:\Progra~1\test\testfire.EXE WITH tf_str


I placed the following line of code : PARAMETERS TF_str

as the very first line of code in the "called" EXE's start-up program (.prg) file AND as the very first line of code in that other Exe's main form Init Event.

I suppose storing values to a one record local table would be more fleible since:
1) Changes are constantly being made and...
2) Exe's are from two different unit's development teams.

Thanks for the assistance,

Dave

The 2nd mouse gets the cheese.
 
JimStarr:

What's the difference between using shellexecute and the code you suggest: do myprog2.exe ???

I was not aware of your method, and wonder what the differences are between the two techniques.

Thanks,

Jim Nelson
 
Hi Jim,

They both get the same result but using the DO statement just feels simpler to me. Also, I don't think shellexecute() was available until VPP6 or 7.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top