Click here to Skip to main content
11,496,146 members (659 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: VC8.0
How to resolve Waitformultipleobjects returning -1?
Posted 2-Mar-11 21:02pm
SAKryukov at 3-Mar-11 2:21am
Why didn't you read the help on this API as I suggested?

1 solution

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 RyanDev 230
1 Sergey Alexandrovich Kryukov 114
2 Richard Deeming 100
3 OriginalGriff 89
4 Mostafa Asaduzzaman 59
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600

Advertise | Privacy | Mobile
Web04 | 2.8.150520.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