How to call CreateEvent() in Windows CE 3.0 ?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.

So I backtrack and call GetLastError() after the call to CreateEvent().
When I pass this into FormatMessage it says: "This function is only
valid in Win32 mode".

What does this mean ? I am using embedded Visual C++ 4.0 IDE. Target
CPU is set to "Win32(WCE ARMV4) Release".

MSDN for CreateEvent() under Windows CE 3.0 says that I need to link to
Coredll.lib and nk.lib for CreateEvent(). I've added Coredll.lib to
the link tab of my project settings but I can't find nk.lib. MSDN
indicates that nk.lib is part of the kernel. So that means I don't
need to link to it ?

But I am still getting an invalid handle according to
WaitForMultipleObjects() and GetLastError() called after CreateEvent()
still indicates an invalid function.

Can anyone help me on this ?

Brian Jorgage

.



Relevant Pages

  • Re: How to call CreateEvent() in Windows CE 3.0 ?
    ... When this handle is passed to WaitForMultipleObjects() ... GetLastError indicates an invalid handle. ... > So I backtrack and call GetLastErrorafter the call to CreateEvent(). ... Prev by Date: ...
    (microsoft.public.windowsce.embedded)
  • 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)
  • 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: Exceptions in API
    ... > extended error information, call GetLastError. ... if you pass an invalid ... you will get an exception. ... to an API function. ...
    (microsoft.public.win32.programmer.kernel)
  • SetCommState fail to work in c#! Help!
    ... SetCommState fail to work in C#, i keep gettting the error of 87, invalid ... There is a difference between GetLastError and GetLastWin32Error ... - returns 87 (invalid parameter) ... internal static extern bool SetCommState(IntPtr hFile, ref Dcb lpDcb); ...
    (microsoft.public.dotnet.languages.csharp)