?
Solved

Creating Events

Posted on 1998-08-14
4
Medium Priority
?
227 Views
Last Modified: 2013-11-20
How do you create an event?
0
Comment
Question by:Jason_G
  • 2
4 Comments
 
LVL 2

Expert Comment

by:bernfarr
ID: 1320791
What kind of event? What do you want to do with it, presumably send it to something? Your own application, another one?
0
 
LVL 1

Author Comment

by:Jason_G
ID: 1320792
Well, I've create a thread using ::CreateThread, how would I create an event?

0
 
LVL 2

Expert Comment

by:bernfarr
ID: 1320793
What do you mean by an event, a message that you're sending somewhere? Or something else.
0
 
LVL 2

Accepted Solution

by:
jstolan earned 200 total points
ID: 1320794
The purpose of an event id interprocess communication.  You can create the event in either thread using the "CreateEvent" call.  There are some options, but the simplest call is something like

HANDLE hEventHandle = CreateEvent(NULL,TRUE,TRUE,"MyEvent");

Now when another thread makes the same call, it won't create a new event, it gets a handle to the same event you created above.  By using SetEvent or ResetEvent you can then have the two threads communicate.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question