Re: How to call CreateEvent() in Windows CE 3.0 ?

Tech-Archive recommends: Speed Up your PC by fixing your registry



brianjorgage@xxxxxxxxx wrote:
> I am making a call to CreateEvent():
>
> hEvent[0] = CreateEvent(NULL, TRUE, FALSE, NULL);
>
> Simple enough. When this handle is passed to WaitForMultipleObjects()
> it returns -1. GetLastError indicates an invalid handle.

What is 'hEvent'? If it's a HANDLE, you can't use [0] on it, if it's an
array or a pointer the 'h' prefix is a lie.

> So I backtrack and call GetLastError() after the call to CreateEvent().

You should check the returnvalue and log that error anyways.

Uli

.



Relevant Pages

  • Re: a synchronization issue - jusy for you guys
    ... CreateEvent: ... If the function succeeds, the return value is a handle to the event ... the function returns a handle to the existing object and GetLastError ... To get extended error ...
    (comp.lang.pascal.delphi.misc)
  • How to call CreateEvent() in Windows CE 3.0 ?
    ... GetLastError indicates an invalid handle. ... So I backtrack and call GetLastError() after the call to CreateEvent(). ... WaitForMultipleObjects() and GetLastErrorcalled after CreateEvent ...
    (microsoft.public.windowsce.embedded)
  • Re: openevent win ce 5.0, returns error code 183
    ... I'm quite sure that CreateEvent and OpenEvent end up calling the same ... function in the kernel so I imagine that ou get ERROR_ALREADY_EXIST as if ... // print GetLastError() ...
    (microsoft.public.windowsce.app.development)
  • Re: WaitForMultipleObjects returning ERROR_INVALID_HANDLE
    ... According to the documentation 'WaitForMultipleObjects' never returns 'ERROR_INVALID_HANDLE'. ... 'WaitForMultipleObjects' returns 'WAIT_FAILED' and the subsequent call to 'GetLastError' returns 'ERROR_INVALID_HANDLE'. ...
    (microsoft.public.vc.language)
  • Re: WaitForMultipleObjects returning ERROR_INVALID_HANDLE
    ... GetLastError() returns ERROR_INVALID_HANDLE? ... According to the documentation 'WaitForMultipleObjects' never returns ... the subsequent call to 'GetLastError' returns 'ERROR_INVALID_HANDLE'. ...
    (microsoft.public.vc.language)