By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,820 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,820 IT Pros & Developers. It's quick & easy.

Trouble with using "system function"

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
"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.