Trouble with using "system function"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leila  Y

    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.
  • lallous

    #2
    Re: Trouble with using "system function"

    "Leila Y" <lyusefi@yahoo. com> wrote in message
    news:2df6c970.0 405112342.3cf3f 398@posting.goo gle.com...[color=blue]
    > 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[/color]
    the[color=blue]
    > 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.[/color]

    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.publi c.win32.program mer.kernel

    Regards,
    Elias


    Comment

    Working...