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

Invoking another programm from C++ code! 1

Status
Not open for further replies.

Dhafir

Programmer
Sep 22, 2002
28
0
0
NZ
Hi all,
I need to invoke another programm written in C++ (works as a utility to the main program).
I need to pass in parameters to the other program when I invoke it and wait for a return value.
How can I do that please?
I know there must be a function call to invoke another program and a way to get a return value from it.

Thanks for any help

Dhafir
 
ShellExecute()
ShellExecuteEx()

there are others as well but that will get you started

-pete
 
Hi Dhafir.
There are a few ways of doing this. If the program is a console application, try 'spawnl()' functions.
'ShellExecute()' and 'ShellExecuteEx()' could be used as well as 'WinExec()' functions in a Windows program, but the prefered way of control is by using the 'CreateProcess()' function. This can be used for either console or window process creation.

Adonai :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top