Trouble with using "system function"

L

Leila Y

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.
 
L

lallous

Leila Y said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top