|
-
April 22nd, 1999, 08:34 AM
#1
Waiting for termination
I am trying to make a Win 32 application(DOS only) that will launch a program and wait until it terminates in Visual C++ 5. It also has another thread that updates a file every minute(launched with _beginthread). The problem I run into is that I do not know how to launch a program and wait for it to terminate. Could someone please help me with this?
Thanks.
-
April 22nd, 1999, 08:40 AM
#2
Re: Waiting for termination
Try the WaitForSingleObject() API call.
Use the handle returned from _beginthread to identify the object to
wait for.
-
April 22nd, 1999, 10:34 AM
#3
How would I...
...launch the application(and arguments) with _beginthread?
-
April 23rd, 1999, 07:25 AM
#4
Re: How would I...
>>...launch the application(and arguments) with _beginthread?
You don't. I misunderstood. However, within an application you can
detect thread termination using WaitForSingleObject. The beauty of
this call is that the handle passed can be a handle to all manner of
things. You can lauch your application by calling CreateProcess, and
the handle returned will identify it. Then call WaitForSingleObject
passing the process handle and you will detect when the process has
ended. Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|