Hi Folks,
I'm working on a quiz project started with the 3.5 template that came
with Codewarrior. I'm having difficulty with one of my forms, which has
two lists that I'm using for matching. Here's the code:
static void MatchingFormInit(FormPtr frmP)
{
ListPtr lstP;
Int16 i;
// block 1
lstP = GetObjectPtr( MatchingRightList );
LstSetSelection( lstP, -1 ); // no selection for this list
lstP = GetObjectPtr( MatchingLeftList );
LstSetSelection( lstP, -1 ); // no selection for this list
// initialize match data -- block 2
for (i = 0; i < 5; i++ ) {
gMatchVar[ i ] = -1;
}
}
If I comment out all the code in this routine, everything works
normally. If I include the code in block 1, I can switch to this form
ok, and it seems to work as I'd hope, but then when I try to bring up
the menu on this form, I get a bus error. If I include block 2, I get a
bus error as soon as I try to switch to this form (it looks like when
the FrmDrawForm routine is called).
I'm frustrated and mystified! Thanks in advance for any help and/or
insight into what might be going on.
Sean
P.S.
Here's a bit of supporting definitions and code:
/***********************************************************************
*
* Global variables
*
***********************************************************************/
Int16 gMatchVar[4];
static void * GetObjectPtr(UInt16 objectID)
{
FormPtr frmP;
frmP = FrmGetActiveForm();
return FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, objectID));
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/