If there is no place in the user event structure for it, then you could
always allocate a handle & stuff it into a feature w/ the same number
as the event type.  When processing the event you could retrieve
the data with the feature manager.  (note: this only works if you
know you will never have more than one event of any given type
in the queue at any given time.)

However, you shouldn't have to resort to that.  The EventType
struct is a union of many event-specific sub-structs.  One of
those is "generic" which has 8 word-length fields called "data1"
through "data8".  If you want to define your own struct with meaningful
fields you could always union it with the EventType struct ... just
make sure that you don't exceed the size of the EventType struct,
and be sure to duplicate the common fields of EventType (the
fields before the union).

--
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi/sec: not just a good idea, it's the LAW!


Jason Partyka wrote in message <[EMAIL PROTECTED]>...

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.

Basically I'm looking for the most flexible way to include data with an
event.

-JP-

>>> [EMAIL PROTECTED] 12/07/00 09:26AM >>>
Hi, I do it like this, not sure its the best way, buts it neat and it works.

typedef enum { /* User defined events */
userReadPort = firstUserEvent,
userValidMsg,
userRadioBattLow,
userVectorRedraw,
userModeChange
} user_eventsEnum;


EventType user_event;
/* Post our own event to the queue */
user_event.eType = (eventsEnum)userRadioBattLow;
/* Add other paremeters here */
EvtAddEventToQueue (&user_event);


Get the event as any other palm event.

Rik
> -----Original Message-----

> From: Jason Partyka [SMTP:[EMAIL PROTECTED]
> Sent: 07 December 2000 15:10
> To: Palm Developer Forum
> Subject: RE: [W]  Multiple Threads under Codewarrior
>
> By user defined messages you mean user-defined events, right? I haven't
> figured out a way to include data with user-defined events, although that
> may be due to limited experience in C. Is such a thing possible on the
> Palm, and if so, can someone point me to documentation on how to do so?
>
> -jp-
>
> >>> [EMAIL PROTECTED] 12/07/00 08:41AM >>>
> As the OS is message based, you can sort of have psuedo threads, activated
> by messages, although they will have to run to completion. I think a lot
> of
> people dont use the message based stuff to its full potential. User
> defined
> messages are very usefull. A Windows 3.1 programming background is usefull
> here.
>
> Rik
>
> > -----Original Message-----
> > From: Steve Stover [SMTP:[EMAIL PROTECTED]
> > Sent: 07 December 2000 16:23
> > To: Palm Developer Forum
> > Subject: RE: [W]  Multiple Threads under Codewarrior
> >
> > Thanks, Rik,
> >
> > That's what I figured.  It will make this data log timing loop much more
> > convoluted, but doable.  Oh well...   :(
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of
> Richard
> > Anderson
> > Sent: Thursday, December 07, 2000 6:13 AM
> > To: Palm Developer Forum
> > Subject: RE: [W]  Multiple Threads under Codewarrior
> >
> > Your not allowed/supposed to used multiple threads in Palm apps full
> stop.
> >
> > Rik
> >
> > > -----Original Message-----
> > > From: Steve Stover [SMTP:[EMAIL PROTECTED]
> > > Sent: 07 December 2000 15:58
> > > To: Palm Developer Forum
> > > Subject: [W]  Multiple Threads under Codewarrior
> > >
> > > Hello Palmreaders,
> > >
> > > I don't remember any mention or discussion of multiple "Thread"
> > > programming
> > > under Codewarrior.  Are multiple threaded programs possible under
> > > Codewarrior, and where do I find information about it if it is
> possible?
> > >
> > > Thanks,
> > > Steve Stover
> > > SRC
> >
> >
> > --
> > For information on using the Palm Developer Forums, or to unsubscribe,
> > please see http://www.palmos.com/dev/tech/support/forums/
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/

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








-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to