Shell to another C++ program

Hi

I want to shell to another C++ program i have written but cannot find out how to do it properly.

I'm using Visual 2003 .NET, the first program i've written in C++ wants to call the second program i've also written, just to say "hello world" would be great. I know how to use the argc argv bits but i don't know the keyword or shell command to call the second program.

I thought it was 'shell', but no, i've tried, exec, call, shellexececute commands in all the help files but i don't know which one to use. Just a plain simple shell would be nice.

Program 1 to say "hello from program 1"
Program 2 to say "hello from program 2"
Thats it.

Any ideas chaps & chapesses.....?


Comments

  • : Hi
    :
    : I want to shell to another C++ program i have written but cannot find out how to do it properly.
    :
    : I'm using Visual 2003 .NET, the first program i've written in C++ wants to call the second program i've also written, just to say "hello world" would be great. I know how to use the argc argv bits but i don't know the keyword or shell command to call the second program.
    :
    : I thought it was 'shell', but no, i've tried, exec, call, shellexececute commands in all the help files but i don't know which one to use. Just a plain simple shell would be nice.
    :
    : Program 1 to say "hello from program 1"
    : Program 2 to say "hello from program 2"
    : Thats it.
    :
    : Any ideas chaps & chapesses.....?
    :
    :

    ShellExecute should work. There is also CreateProcess, which is probably the preferable way. Or for minimum effort looking through the function documentations, use system("myprog.exe -x -y").

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion