0

I have main program and system windows calculator. I want to run calculator from main prograM then wait while user close it and then give up control to the main program.

I try this solutions:

auto child = boost::process::child("calc.exe");
child.wait();

and

auto child = boost::process::child("calc.exe");
while (child.running()) {}

And in both ways calculator start but main process don't wait until the child closes and run farther.

How I should do this?

dasfex
  • 1,148
  • 2
  • 12
  • 30
  • You'll need to use the `start /wait calc.exe` trick. How to do that from boost::process::child is left as an exercise. – Eljay Apr 28 '21 at 12:40
  • 2
    You seem to be waiting in right way. Probably `calc.exe` is just a launcher for the real calculator and your program actually progresses when it finishes – bartop Apr 28 '21 at 12:40
  • You are running on Windows 10. *calc.exe* isn't the Calculator application. It's a launcher that exits right after it launched Calculator. – IInspectable Apr 28 '21 at 13:29

0 Answers0