Unclebump,
Perhaps you could illuminate us a bit more on what, exactly, you are trying to do, and on what OS.
How, exactly, you accomplish event driven programs depends slightly on
your windowing system (assuming that it is window events that you are
interested in, I suppose). Kcaero's suggestion about VC's member
methods, etc., is essentially a wrapper around the basic structure of a
Windows program. This structure has a "message pump" somewhere at the
bottom which gets messages from a message queue, and then dispatches
them to the appropriate handler function, which is typically associated
with the window or ancestor of the window that generated the event.
So, if its that aspect that you're interested in, and you're working on windows, check out the following windows functions:
GetMessage
TranslateMessage
DispatchMessage
These events are generated by the OS itself, so you don't have to waste resources scanning.
Hopefully, the OS is also being efficient about it as well
🙂
CreateEvent, and other forms of signalling are probably
not what you are interested in unless you are trying to both generate
and process the events. The only reason to not let the OS handle the
event generation is if you are creating your own events. At least
that's the only reason I can think of off hand.