Vereecke Jan wrote:
> The SDK reference doesn't explain how EvtAddEventToQueue works
> with memory.  I assumed it takes a copy of the event pointed at,
> so I could use an auto variable for the event information.

Correct, it makes a copy, so your code is safe.

> The third possibility I saw was to re-use the event that triggered
> my formHandler in the first place, but I expected that event to be 
> freed by someone somewhere unless I did something exotic.

The EventType object that gets passed through the handlers is actually
the one you provide yourself in your event loop, where you call
EvtGetEvent.  That API copies the event data into your EventType
structure, and does not return a pointer to anything internal or to
anything that must be freed.  So you can do whatever you want to that
structure after calling EvtGetEvent.

-slj-

Reply via email to