Click here to Skip to main content
11,924,825 members (55,681 online)
Rate this:
Please Sign up or sign in to vote.
See more: VC8.0 C++
How to resolve Waitformultipleobjects returning -1?
Posted 2-Mar-11 21:02pm
SAKryukov 3-Mar-11 2:21am
Why didn't you read the help on this API as I suggested?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Check out the return codes secion of MSDN[^].

WAIT_FAILED (0xFFFFFFFF) The function has failed. To get extended error information, call GetLastError.
Edit: To clarify, 0xFFFFFFFF == -1. Search google for signed/unsigned conversions if you don't know why.

If you go on to read GetLastError[^] you will come across something like this, which prints to the console the error code and associated message from the pages at[^]
LPSTR szMessage;
DWORD nErr = GetLastError();
printf("Error 0x%08X (%u): %s\n", nErr, nErr, szMessage);
SAKryukov 3-Mar-11 2:20am
Correct, my 5.
Please pay attention, OP repeats questions and do not pay enough attention to Answers, got my warning...
Andrew Brock 3-Mar-11 2:21am
Apparently I havn't been paying attention. Thanks.
Gokulnath007 3-Mar-11 2:21am
I am using Windows 7 OS 64 bit. CreateEvent returns 0x0 value to the handle.. How to implement Createevent in Windows? pls help me..
Andrew Brock 3-Mar-11 2:23am
Perhaps you should learn MSDN. Check out

The same code can be used for printing the error associated with most Windows API functions.
I suspect your event name is malformed.
SAKryukov 3-Mar-11 13:59pm
You need to show your code!
Sandeep Mewara 3-Mar-11 2:22am
Good answer. 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151125.3 | Last Updated 3 Mar 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100