Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8101211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:55:43+00:00 2026-06-05T22:55:43+00:00

I am using WaitForMultipleObject function with waitForAll parameter = true. Here using a std::vector

  • 0

I am using WaitForMultipleObject function with waitForAll parameter = true. Here using a std::vector of handle object to wait for. If this function is timed out, then how can i identify that waiting on which handle is timed out??.

if(WAIT_OBJECT != WaitForMultipleObject(vector.size(), vector.data(), true, 16000))
{
//get the event that causes the wait to time out(assume that only one object is timed out.others are successfully set.)
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:55:44+00:00Added an answer on June 5, 2026 at 10:55 pm

    According to MSDN’s WaitForMultipleObjects function definition:

    Return value minus WAIT_OBJECT_0 indicates the array index of the object that satisfied the wait. If more than one object became signaled during the call, this is the array index of the signaled object with the smallest index value of all the signaled objects.

    So, you just need to check: if the function succeeded – it’s all OK, if not, than check what kind of handles were in the array and the ones which weren’t. Thus you can figure out the problematic handle.

    Also, I suggest you take a look at the SignalObjectAndWait function. Its behaviour is different, but maybe you will find it useful in some cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include <iostream> #include <iomanip> #include <stdio.h> #include <windows.h> #include <process.h> using namespace std; HANDLE
I'm using the WaitForMultipleObjects function to wait for the finalization of several threads, but
I have a vector<HANDLE> . I want to wait for all of them to
Using .live() : <input type=button value=button /> $(:input[type=button]).live({ click: function() { $(this).after('<input type=button value=new
If I'm using WaitForMultipleObjects, and the function returns WAIT_TIMEOUT, how can I get which
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
I've got a loop in my code that uses std::basic_string<HANDLE> , and then waits
Basically, I'm looking to do something like this: HANDLE hThread1 = CreateThread(...); HANDLE hThread2
Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True)
For the life of me I can't figure out why this is not working.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.