0

I solved it with command System(.. .exe); And .exe application starts. But my VS C++ code stops and will continue only when I'll close started .exe application. How can I continue my C++ code with opened and run .exe application?

metcenger
  • 63
  • 5

1 Answers1

0

You can either fork your process, and start your application in the child process, or you can run a new thread which will block untill your application terminates.

limserhane
  • 1,022
  • 1
  • 6
  • 17
  • Is there method to run my app with same process with my C++ app? Or I should only run .exe in the another thread? – metcenger Jul 22 '22 at 13:20
  • But fork will create copy of process, not run another exe... – Andro Jul 22 '22 at 13:21
  • Note that processes and threads are not the same. A fork will indeed create a copy of the process that you can use to run your app (with a system call like [`exec*`](http://manpagesfr.free.fr/man/man3/exec.3.html) for linux). – limserhane Jul 22 '22 at 13:24
  • I run my c++ code on the windows. Which way will be preffer for me? – metcenger Jul 22 '22 at 13:28
  • 1
    `fork` does not exist on Windows (except, I guess, in WSL) – Paul Sanders Jul 22 '22 at 17:29