
Multithreading in Visual C++
I am creating an application through which I create another process that
runs a Perl script on DOS. When the Perl script is running , I want to
display a dialog box that provides a user the mechanism to cancel or
continue running the script. To display this dialog box, I am spawning a
thread. The problem is that when the Perl script is running, the dialog
box does not show on the screen until the Perl script terminates.
I am creating the Perl Script process using CreateProcess API call
and Spawning the Thread for Displaying the Dialog Box using
AfxBeginThread.
The main process has to wait for the Perl Script to terminate to get
the Exit code from the Script as it is required for further
processing.This waiting is implemented using GetExitCodeProcess API call
in a "While" loop.
Note: The Perl Script is running on Dos.