Anamika, I would first suspect the data that you save in LinkToolInputData_st prior to switching to form B.
Look at the data in LinkToolInputData_st.siteSep_arr_15 before copying it to your new chunk. Is it what you expect and is it limited to 5 chars? If this is hard to reproduce, I would bet that the emulator/simulator craps out at the same event number if you start from scratch each time. If so, run the emulator with a limit of (X - 10) max events and then trace the last 10 events in your code by single stepping the gremlin events and break pointing in the code you posted. Other than that, you might post your LinkToolInputData_st structure and the code that saves the data prior to switching to form B. Ralph "Anamika NG" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, > > My application has a form with several field objects in it. I have limited the no. of chars to be > entered for each field to 5 chars.User enters some data > in the field and when he navigates to form "B", all the user input data are stored in a structure variable. > When he returns to this Form 'A', I read the saved data and display them back to the user. > > I am testing my PDA application on Emulator with Palm OS 4.1.2. While running the Gremlins , it crashes saying > "XYZ application called sysFatalAlert with the message : Field.c , Line 264, Invalid word wrapping info". > > If I press the continue button when the crash happens, it says > "XYZ application called sysFatalAlert with the message : Field.c, Line 195, Text block size small than text." > > If I again press the continue button, it complains saying > "XYZ application just read from memory location 0xBD700001, causing a bus error. A bus error.......": > > When I look at the stack window, I noticed that the last 4 events at the time of crashing are > "LinkToolFormHandleEvent, > FldGetTextPtr, > FldGetTextPtr, > ValidateField" > > Unforunately I don't know the assembly code to debug in detail. > Does anybody know what does these error means and how to debug this problem. > > I have enclosed part of my code just incase somebody is interested. > > static FieldPtr fld1 = NULL; //global variable > > void LinkInputParaForm1Init() { > static UInt8 linkToolDataCleared_u8 = 0; > MemHandle txtH[13], oldHandle; > Err err, errFreeMem; > > //Pointer to Form. > FormPtr frmP; > UInt16 butID; > char* p = NULL; > > frmP = FrmGetActiveForm(); > > // Draw the LinkTool Input form. > FrmDrawForm(frmP); > > //First time, the user has launched the link tool. Reset all the concerned variables. > > if(linkToolDataCleared_u8 == 0 ) { > //reset all the variables in the link tool data structure. > MemSet((void*)&LinkToolInputData_st, sizeof(LinkToolInputData_st), 0); > > MemSet((void*)&lat1_st, sizeof(lat1_st), 0); > MemSet((void*)&lon1_st, sizeof(lon1_st), 0); > MemSet((void*)&lat2_st, sizeof(lat2_st), 0); > MemSet((void*)&lon2_st, sizeof(lon2_st), 0); > LinkToolInputData_st.units_arr_10[0] = NULL; > LinkToolInputData_st.distMethod_arr_30[0] = NULL; > MemSet(dataEntered_u8, sizeof(dataEntered_u8), 0); > > //set this flag so that you dont reset the variables every time this page is opened up. > linkToolDataCleared_u8 = 1; > > } > > //If the user has made the selection, display the selected values on the screen. > > if((LinkToolInputData_st.dstMethod_e == Direct) && fld1) { > > txtH[0] = MemHandleNew(sizeof(LinkToolInputData_st.siteSep_arr_15) + 5); > > //If successful in getting handle to the new chunk, proceed. > if(txtH[0]) { > p = (char *)MemHandleLock(txtH[0]); > > if(p) { > StrCopy(p, LinkToolInputData_st.siteSep_arr_15); // you'd copy from saved data, presumably > > err = MemHandleUnlock(txtH[0]); > ErrFatalDisplayIf(err, "Could not Unlock Chunk."); > }//end if > > fld1 = (FieldType *)FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, LinkToolInputPara1SiteSepField)); > oldHandle = FldGetTextHandle(fld1); > // ErrFatalDisplayIf(!oldHandle, "Couldn't get Text Handle"); > > FldSetTextHandle(fld1, txtH[0]); > FldDrawField (fld1); //draws the contents of the field. > > if (oldHandle) { > errFreeMem = MemHandleFree(oldHandle); // or do something else with it first > ErrFatalDisplayIf(errFreeMem, "Could not Free Handle."); > }//end if > > } //end if > } > > > Thanks in advance for any help. > > Cheers, > Anamika > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
