[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

WaitForSingleObject returns WAIT_OBJECT_0

Posted on 1998-02-21
3
Medium Priority
?
2,857 Views
Last Modified: 2013-12-03
I'm calling CreateProcess(
   tzAppName,
   NULL,
   NULL,
   NULL,
   FALSE,
   0,
   NULL,
   NULL,
   &StartupInfo,
   &ProcessInfo );

and then

WaitForSingleObject( ProcessInfo.hHandle, INFINITE );

CreateProcess returns TRUE, and WaitForSingleObject
returns WAIT_OBJECT_0. Exectution continues
seemingly without pause. Which is bad, because I'm
waiting for the executable module to exit. Help says
WAIT_OBJECT_0 means "The state of the specified
object is signaled."

The app I'm launching is an internal Setup program, for
what that's worth. Anybody know what gives?
0
Comment
Question by:barrett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 300 total points
ID: 1411448
WAIT_OBJECT_0 means that what you were waiting for happened.  Your process finished.  My guess is that your process in not starting properly.  Use the GetExitCodeProcess function to find out what happened to your process and why it died so quickly.
0
 

Expert Comment

by:flfmdll
ID: 1411449
Your new process is exiting with a signaled state. That's a given I suppose. Perhaps your exit or return value is 1 no matter what for this process. You can look into the code to change it. Something is not working in your new process, returning, and making your WaitForSingleObject think it is okay to continue. It seems your code for spawning it is okay.
0
 

Author Comment

by:barrett
ID: 1411450
As it turns out, the exe I was spawning was just a stub that launched another process. Once I got the name of the other mutex, everything was fine. Thanks for answering...
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question