Hi

I call the following code in my call to EvtGetEvent, but I think it does not
work because there are not many events going off and calling this function
and updating it. If I return 0 instead of evtWaitForever, it works but then
crashes with a fatal exception (on the hardware only, works fine on the
emu), I think this is due to too many events (but i may be wrong). Does
anyone have a nice way of creating events approximatly every 1 second ???

static Int32 TimeUntilNextRead (void)
{
        static UInt32 time_of_last_read = 0;
        UInt32 current_time = TimGetSeconds ();

                                                
        time_remaining = time_till_next_read - TimGetTicks ();
                
        if (current_time > time_of_last_read)           
        {
                EventType user_event;                   /* Post our own
event to the queue */
                user_event.eType = (eventsEnum)userReadPort;
                EvtAddEventToQueue (&user_event);
                
        }
                
        time_of_last_read = current_time;
                
                
        return evtWaitForever;                          /* Return time
remaining */
        }
}


Thanks

Richard Anderson

-- 
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