I'm having issues returning from a form called by using FrmPopupForm.  Here's 
snippits of my code:

In my main form menu handler:
        case EditPrefs:
          FrmPopupForm(PrefsForm);
          handled = true;
          break;

In my application event handler:
    switch ( uiFormId ) {
      // ...

      case PrefsForm:
        FrmSetEventHandler ( formP, PreferencesFormHandleEvent );
        handled = true;
        break;

      default:
        break;
    }

And my PreferencesFormHandleEvent function is a standard (and supposedly good) 
event handler for forms.  The important part:

    case ctlSelectEvent:
      switch ( eventP->data.ctlSelect.controlID ) {
        case PrefsOKButton:
          // Save the fields into my preferences structure...

        case PrefsCancelButton:
          FrmReturnToForm(MainForm);
          handled = true;
          break;

What's wrong with this?  When run, GDB gives me the following output:
        Program received signal SIGTRAP, Trace/breakpoint trap.
        0x10079aba in FrmValidatePtr ()
        (gdb) backtrace
        #0  0x10079aba in FrmValidatePtr ()
        #1  0x1007a9d6 in FrmHandleEvent ()
        #2  0x5b528 in ?? ()
        #3  0x10075824 in PrvSendEventToForm ()
        #4  0x100793e0 in FrmDispatchEvent ()
        #5  0x1178e4 in EventLoop () at quickback.c:1091
        #6  0x117c74 in PilotMain (cmd=0, cmdPBP=0x0, launchFlags=142)
            at quickback.c:1192

And looking at the source code for the PalmOS, FrmHandleEvent is dying when 
checking to see if the form pointer it's handed is valid.  Why? ... I'm kinda 
lost here, but continuing gives me a few errors of the OS writing to odd 
locations of unassigned memory, and appears to continue fine from then on.

This happens weather I save my prefs or not (cancel/OK button), so that's not 
it.

-- 
Matthew (Darkstorm) Bevan       [EMAIL PROTECTED]
Margin Software, NECTI.         http://www.marginsoftware.com
        Re-inventing the wheel, every time.

 - A formal parsing algorithm should not always be used.
                -- D. Gries


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

Reply via email to