Click here to Skip to main content
11,805,316 members (65,478 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VC8.0 C++
How to resolve Waitformultipleobjects returning -1?
Posted 2-Mar-11 20:02pm
SAKryukov at 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 at 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 at 3-Mar-11 2:21am
Apparently I havn't been paying attention. Thanks.
Gokulnath007 at 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 at 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 at 3-Mar-11 13:59pm
You need to show your code!
Sandeep Mewara at 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
0 OriginalGriff 315
1 Sergey Alexandrovich Kryukov 200
2 Richard Deeming 200
3 CPallini 160
4 CHill60 150
0 OriginalGriff 3,265
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | 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