You don't swap the event structure pointer (that's what you're almost trying
to do). You need to swap the contents of it.

EventType *eventP =
(EventType*)((SysNotifyParamType*)cmdPBP)->notifyDetailsP;

Then swap the fields in the struct like this:

ByteSwap16( eventP->eType )
ByteSwap16( eventP->data.keyDown.chr )
etc...


Cheers,
Gavin.

Danny Wong <[EMAIL PROTECTED]> wrote in message news:107281@palm-dev-forum...
>
> i,
>
> I have this code and the simulator chokes on it.
>
> EventType event;
> UInt32 value;
>
> // copy the event
> memcpy((void *)&event, ((SysNotifyParamType*)cmdPBP)->notifyDetailsP,
> sizeof(EventType));
>
> value = EndianSwap32(event);
>
> do you have an example?
>
> thanks
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Ben
> > Combee
> > Sent: Thursday, January 02, 2003 4:27 PM
> > To: Palm Developer Forum
> > Subject: Re: how to get data out of sysNotifyEventDequeuedEvent
> >
> >
> > At 16:18 2003-1-2 -0700, you wrote:
> > >hi,
> > >
> > >what is the correct way to get data out of
> > >sysNotifyEventDequeuedEvent?
> > >
> > >tried swapping endian but it doesn't work.
> >
> > You need to both swap endians and also account for structure padding
> > differences -- on the ARM CPUs, 32-bit values have to be aligned
> > on 4-byte
> > boundaries.
> >
> > --
> > Ben Combee <[EMAIL PROTECTED]>
> > CodeWarrior for Palm OS technical lead
> > Palm OS programming help @ www.palmoswerks.com
> >
> >
> > --
> > For information on using the Palm Developer Forums, or to
> > unsubscribe, please see http://www.palmos.com/dev/support/forums/
> >
> >
>
>
>



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

Reply via email to