PLEASE DISREGARD THIS AS I FIGURED OUT MY MISTAKE, THANKS!

>>> [EMAIL PROTECTED] 11/15/04 03:25PM >>>
I use a few key global variables in my application.  One of which is "Refresh". 
 I use it at the beginning of each FormEventHandler to determine if there are 
fields and/or buttons that need to be initialized from data contained in a 
specific record.  This worked fine until today and now for some odd reason, one 
very important variable "Refresh" is updated in the AppEventLoop function, 
specifically by the line "FrmDispatchEvent(&event);"

Here is a code excerpt:

-----------------------------------------------------------------------------------------------------------------------------------------

// some other function]

        case 1001:
                ActiveChannel = 1;
                Refresh = true;
                FrmGotoForm(2700);
                handled = true;
                break;


static Boolean Tune12FormHandleEvent(EventType* pEvent)
{
//  initialize local variables here

        pForm = FrmGetActiveForm();
        if(Refresh == true)
        {
                RetrieveSliderPositions(ActiveChannel);

                recordH = DmGetRecord(OemDB, ActiveFile);
                if(recordH == NULL) return DmGetLastErr();
                record = MemHandleLock(recordH);
        
                Car = *record;

                WriteNumberToField(Car.CH[ActiveChannel].FILTERFREQ, 1003);
                                Refresh = false;
                    }

        switch (pEvent->eType) {
                case frmOpenEvent:
                        pForm = FrmGetActiveForm();
                        FrmDrawForm(pForm);
                        handled = true;
                        break;

                case ctlSelectEvent:
                        switch (pEvent->data.ctlSelect.controlID)
                        {
                                case 1000:
                                        ShowHelp(1400);                 // 
blank help screen
                                        handled = true;         
                                        break;                                  

-----------------------------------------------------------------------------------------------------------------------------

When I step thru the debugger, I can see Refresh = TRUE when it's supposed to, 
but changes to FALSE when it hits this line...

static void AppEventLoop(void)
{
        Err                     error;
        EventType       event;

        do {
                EvtGetEvent(&event, evtWaitForever);

                if (SysHandleEvent(&event))
                        continue;
                        
                if (MenuHandleEvent(0, &event, &error))
                        continue;
                        
                if (AppHandleEvent(&event))
                        continue;

                FrmDispatchEvent(&event);

        } while (event.eType != appStopEvent);
}



This method works great for me, until today, any help will be MUCH appreciated!




thanks,

~Tony



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