How to call a program from another program ? 
Author Message
 How to call a program from another program ?

Hi !  let's my program is called test1.exe, and let's say I want to call
another program called test2.exe.  How do I do it ?  Is this OS specific ?
I don't know if this is OS specific or outside the scope of standard C++,
but well..  any answer would be apreciated !

Thanks !

-Eric



Wed, 16 Feb 2005 22:19:46 GMT  
 How to call a program from another program ?

Quote:
> Hi !  let's my program is called test1.exe, and let's say I want to call
> another program called test2.exe.  How do I do it ?  Is this OS specific ?
> I don't know if this is OS specific or outside the scope of standard C++,
> but well..  any answer would be apreciated !

See:

_execl, _wexecl, _execv, _wexecv
_execle, _wexecle, _execve, _wexecve
_execlp, _wexeclp, _execvp, _wexecvp
_execlpe, _wexeclpe, _execvpe, _wexecvpe

_spawnl, _wspawnl, _spawnv, _wspawnv
_spawnle, _wspawnle, _spawnve, _wspawnve
_spawnlp, _wspawnlp, _spawnvp, _wspawnvp
_spawnlpe, _wspawnlpe, _spawnvpe, _wspawnvpe

ShellExecute, ShellExecuteEx,

or

CreateProcess

... enough choices for you?  ;-)  (And at that, I probably missed some!)

-cd



Wed, 16 Feb 2005 23:30:55 GMT  
 How to call a program from another program ?

Quote:
> Hi !  let's my program is called test1.exe, and let's say I want to call
> another program called test2.exe.  How do I do it ?  Is this OS specific ?

Call or Start another program ?  To call another Windows program
use WM_COPYDATA.  It is a tricky interface.

To start, use the other list of library functions (CreateProcess, etc...).

Lynn



Thu, 17 Feb 2005 07:47:14 GMT  
 How to call a program from another program ?

Quote:
> ... enough choices for you?  ;-)  (And at that, I probably missed some!)

The platform-independent one:

    system()

And Microsoft's unicode version:

    _wsystem()

-Sean



Sat, 19 Feb 2005 23:54:39 GMT  
 How to call a program from another program ?
If all your wanting to do is call test2.exe from test1.exe
use the folowing statement.

system("test2.exe");

Quote:
>-----Original Message-----
>Hi !  let's my program is called test1.exe, and let's say
I want to call
>another program called test2.exe.  How do I do it ?  Is
this OS specific ?
>I don't know if this is OS specific or outside the scope
of standard C++,
>but well..  any answer would be apreciated !

>Thanks !

>-Eric

>.



Mon, 21 Feb 2005 12:10:10 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to call perl program from C program ?

2. Socket Programming (How to program a timeout mechanism on a read/write call)

3. call asm program from C program

4. Calling a CGI program from a C program

5. calling other programs from my program

6. How do I Call a dos program from within my program

7. calling another program from within a program

8. Calling external programs from within MSVC++ programs on win955

9. Call a Java program from a C++ program?

10. call a program from another program

11. call program B from program A

12. How to call a C program for a fortran program

 

 
Powered by phpBB® Forum Software