CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2007
    Posts
    162

    WaitForSingleObject

    If you use waitforsingleobject after createprocess, and you get a return value of WAIT_OBJECT_0, is this telling you the process has successfully started or that the process started, run its course and then ended.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: WaitForSingleObject

    If you wait for the returned process handle (being a valid handle) then WAIT_OBJECT_0 means the process handle was closed (the process has exited)
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2009
    Posts
    577

    Smile Re: WaitForSingleObject

    Quote Originally Posted by VictorN View Post
    If you wait for the returned process handle (being a valid handle) then WAIT_OBJECT_0 means the process handle was closed (the process has exited)
    To add to above: generally said WaitForSingleObject would wait until the (valid) handle passed was signaled or when the timeout interval given elapsed. For a process handle the docs say:

    Process Handle
    Created by calling the CreateProcess function. Its state is set to nonsignaled while the process is running, and set to signaled when the process terminates.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured