_execv in a dialog

Hi all,
in a dialog, I have a button where I call _execv to start another app:

void CTestDlg::OnButton1()
{

char *args[2],
char *prog = new char[400];
strcpy(prog,"D:\\EXCEL.EXE");
args[0] = "D:\\EXCEL.EXE";
args[1] = NULL;

_execv(prog,args);

}

the program (in this case Excel) starts correctly, but the app (dialog) crash...

Can you please help me on this?

Thanks.
Francesco
[483 byte] By [skuanet] at [2007-11-19 19:31:00]
# 1 Re: _execv in a dialog
1. How does it "crash"?
2. What does _execv return in this case?
3. You could also use ::CreateProcess or ::ShellExecuteEx APIs to start a process
VictorN at 2007-11-10 23:43:37 >
# 2 Re: _execv in a dialog
As Victor said use ::CreateProcess(..) or ::ShellExecuteEx (..).

Look at this FAQ for more info: How can I start a process? ( http://www.dev-archive.com/forum/showthread.php?t=302501)

Cheers
golanshahar at 2007-11-10 23:44:37 >