469,964 Members | 1,754 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

Trouble with using "system function"

Dear Friends,
I need to execute an executable file (*.exe) within visual c++ program.
I have used " system function " for this purpose and it works in most of the
time but sometimes while performing this command it can't close the
MS DOS prompt window and return from it .
I want to know how I can solve this problem and
if there is another way to execute (*.exe) within visual c++ program.

Thanks.
Jul 22 '05 #1
1 1592
"Leila Y" <ly*****@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
Dear Friends,
I need to execute an executable file (*.exe) within visual c++ program.
I have used " system function " for this purpose and it works in most of the time but sometimes while performing this command it can't close the
MS DOS prompt window and return from it .
I want to know how I can solve this problem and
if there is another way to execute (*.exe) within visual c++ program.

Thanks.


Hello

AFAIK, system() (in Windows OS) will use the program specified in %COMSPEC%
environment variable with a /C parameter to launch your program.

A better alternative to execute a program is to use the Windows' specific
functions WinExec(), CreateProcess() or ShellExecute[Ex].

For more information about this, try posting in
microsoft.public.win32.programmer.kernel

Regards,
Elias
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jerry Sievers | last post: by
11 posts views Thread by T O | last post: by
1 post views Thread by Liang Zhang | last post: by
12 posts views Thread by Jon Slaughter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.