Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5841087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:50:36+00:00 2026-05-22T11:50:36+00:00

I have wince 6.0 applcaion in which inside thread applcation is waiting for event

  • 0

I have wince 6.0 applcaion in which inside thread applcation is waiting for event which driver will set. i have created event inside applcation and samevent in driver also. butwhen driver set the event then appcation is not able to catch it.(driver is setting event successfully)

Here is code

// application side
m_hEvent = CreateEvent(NULL,FALSE,FALSE,L"MY_EVENT");
if(m_hEvent)
{
    if(!DeviceIoControl(m_hDriver,CREATE_MY_EVENT,
        (LPDWORD)&m_hEvent,NULL,NULL,NULL,NULL,NULL))
    {
        AfxMessageBox(L"not created event successfully in driver");
    }
    while(TRUE)
    {
        //waiting for driver to setevent
        int RetValue = WaitForSingleObject(m_hEvent,INFINITE);
        if(0 == RetValue )
        {
            AfxMessageBox(L"wait end");
        }
        else
        {
            AfxMessageBox(L"time out");
        }
    }
}

…

//Driver side
BOOL SMP_IOControl(DWORD hOpenContext, DWORD dwCode, 
                   LPDWORD pBufIn, DWORD dwLenIn, LPDWORD pBufOut, 
                   DWORD dwLenOut, PDWORD pdwActualOut)
{
    switch (dwCode)
    {
         case CREATE_MY_EVENT :
         {
             m_hEvent = (HANDLE)(*pBufIn);
             if(NULL != m_hEvent)
             {
                 // getting this message
                 MessageBox(NULL,L"event successfully created",L"success",MB_OK); 
             }
             else
             {
                 MessageBox(NULL,L"no event successfully created",L"success",MB_OK);
             }
         }
         break;
         case SET_EVENT:
         {
             //set event that which application waiting
             if(SetEvent(m_hEvent))
             {
                 // getting this message
                 MessageBox(NULL,L"event set successfully",L"success",MB_OK); 
             }
             else
             {
                 MessageBox(NULL,L"event set successfully",L"success",MB_OK);
             }
         }
         break;
     }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:50:37+00:00Added an answer on May 22, 2026 at 11:50 am

    The inherent problem here is that you’re having one process (your app) create a HANDLE and then passing that HANDLE to the another process (device.exe) and expecting it to be valid. It’s not.

    In this case the solution is simple. System events are unique across the OS by name, so simply call CreateEvent in both places using the same text name. When you call SetEvent in one process, the other process waiting on the HANDLE it created will get signalled.

    That means remove your CREATE_MY_EVENT IOCTL (and that’s a non-standard naming convention, BTW, it should start with “IOCTL_”) handling in the driver and just call CreateEvent in the SMP_Init method and store that HANDLE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing a database on wince platform in EDB. I have created and
I have created an installer for my wince application by following the instructions on
I have build C# program that work with RAPI (communication to PPC or WinCE)
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have two types of custom handhelds which are similar, but slightly different, each
Right now I have a Java application running WMI querying event logs, this is
I have a wince application and am getting the following error message sometimes: An
I have a WinCE device. Is it possible to connect to the device from
I have WinCE device and visual studio 2008 project. I want to deploy and
Here is my problem: I have a closed-source third-party Win32 application, which acts as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.