Click here to Skip to main content
15,887,262 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on a C++ application and I am encountered a problem.

See below a brief description of my application :
There are two processes which work together. The main process (application A ) calls the second one (application B) which is the child of the first one.

Application A : Main application : C++ application with QT interface and a progress bar. It calls an another process with using CreateProcess.

Application B : C++ executable. This exe generates output messages on stdout like :
PROGRESS 1%
PROGRESS 20%
...
PROGRESS 100%

What I would like to do :
I would like to launch the application B with the application A. I mean when I launch the whole application, application A runs and creates another process which launchs the application B. I would like to catch the output of B and update the progress bar of application A.
I have implemented the redirected system explained on this article :
https://support.microsoft.com/en-us/kb/190351

It works but the problem is that the output messages of B are processed when the exe is terminated and not during the execution.
I would like to process the output messages of B during its execution. I was thinking to use the redirected system with using named pipes.
What do you think? Any advice ? any idea ?

Thank you in advance.
Posted

1 solution

I would go for named pipes as desrcibed in this article.

On your code: Are the apps running at the same time, or is the launcher (A) waiting for the termination of B.
 
Share this answer
 
Comments
Zaraki21 10-Jan-16 3:37am    
A is launched first and after B is launched. When B is running, a progress bar in A application has to be updated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900