Aug 9, 2010 at 4:01pm UTC
I was wondering how to make a program open another program.
Aug 9, 2010 at 4:32pm UTC
exec() or CreateProcess() on Windows.
Aug 10, 2010 at 12:32am UTC
exec() or CreateProcess() on Windows.
Didn't work.
Last edited on Aug 10, 2010 at 12:32am UTC
Aug 10, 2010 at 7:49am UTC
can you provide with what code you have written ?
Aug 10, 2010 at 3:16pm UTC
In reply to Zhuge:
It wouldn't open a program.
In reply to firedraco:
I don't know what to try.
In reply to bluecoder:
No because I don't have any programming yet that control the opening of programs and because the code I do have has nothing to do with opening programs.
Aug 10, 2010 at 3:50pm UTC
How do you know it didn't work if you didn't write any code?
Aug 10, 2010 at 5:32pm UTC
well, do the fork and exec the another program in newly created process.
sample code.
int pid = fork()
if(pid==0)
{
exec("your program");
}
execv will overwrite the memory space of newly created process with your program.
Regards.
Aug 15, 2010 at 3:41am UTC
Is there an #include
i'm forgeting cause the compiler says it dosent know what exec
does.
Last edited on Aug 15, 2010 at 3:41am UTC