PDA

View Full Version : Call an external Program


hanan
12-29-03, 04:57 AM
hi every body,

Is there any instryction or way, that call an external program or run it?

thanks.

hyjacked
12-29-03, 09:01 AM
The following link should help you on your way.

http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20805318.html

hanan
12-30-03, 11:39 AM
OK thanx.

but if U know how the second program can take the parameter from the first which supposed to call it?

I'm wating :)

hyjacked
12-30-03, 12:59 PM
do you mean pass the parameter that was given to the first program to the second program. Something like:

first_program.exe parameter

would run then call:
second_program.exe parameter

Is this what you mean?

if so, then you would need to use argc and argv to get the parameters from the first program call

argc is the number of parameters
argv is an array containing all the parameters
argv[0] contains the program name, ie: "program.exe"
each argv after that contains each parameter. spaces distinguish between each parameter.

So when you have that, you can then pass that into the createProcess function

hanan
12-30-03, 02:48 PM
Thank U very much :)
I will try this , then come back if I faced any difficulty .

hanan
01-05-04, 09:58 AM
I give up :(

I wont any example for exic .. just for calling with out arguments.. can I have this ?