"Jason Partyka" <[EMAIL PROTECTED]> writes:

> But there's no place to assign your own data to the data member of
> EventType, is there? I've known about creating your own events, that's
> not a problem. I want the event to carry data with it, though. I
> suppose I could use the "generic" members of the data struct, but I
> haven't seen any documentation that says this is OK.  The problem
> there, though, is that you're limited to the eight members defined by
> it.

Sure it's OK. That's what they're there for. The generic field is just
another member of the event.data union, which is where event data is
meant to be stored.

Do something like

 MemSet(&event, sizeof(event), 0);
 event.eType = myEvent;
 event.data.generic.datum[0] = myval1;
 event.data.generic.datum[1] = myval2;
 EvtAddEventToQueue(&event);

If 8 UInt16's isn't enough to hold your all of your event info, then store
a pointer to your real event data:

  MyEventDataStruct* myPtr;
  MemMove(event.data.generic.datum, &myPtr, sizeof(void*));

Extract it later with

  MyEventDataStruct** evtptr;
  MemMove(&evtptr, event.data.generic.datum, sizeof(void*));

-- 
Dave Carrigan ([EMAIL PROTECTED])            | Yow! Why is it that when you
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | DIE, you can't take your HOME
Seattle, WA, USA                            | ENTERTAINMENT CENTER with you??
http://www.rudedog.org/                     | 

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to