Hi Friends...
I have already posted a version of my problem in the forum. This time i want
to make it more clear..
I am trying to migrate an application from PalmOS 3.1 to Palm OS 3.5.
Application and code work fine with 3.1 but when i try to debug it using
palm OS 3.5 and CodeWarrior 7 (I have made all the changes required to
compile the code on OS 3.5).
Now when i run the .prc on PalmVx i get the login screen(first form) and
after 2 seconds the application crashes...
And when i debug on the emulator(palmos35-en-ezdbg) i get "Bad chunk header"
error in the code below at
    FrmSetFocus(frm, FrmGetObjectIndex(frm,
DataCollectorLoginPasswordFieldField));
I think this has got something to do with the MemHandlelock and unlock.. But
i have no clue as to how to deal with "Bad chunk header" error. And i have
already spent 3 days working on this...

Hope someone can help me with this.
Thanks
Praveen


static Boolean LoginFormHandleEvent(EventPtr event)
{

 Boolean  handled = false, checkPass=false;
 EventType newEvent;
 FormPtr     frm;
    int         i=0;
    Word        fldIndex1, fldIndex2;
    FieldPtr    fld1, fld2;
    CharPtr     textID;
    CharPtr  textPass=NULL;
    CharPtr     title;

    VoidHand    recordH;
    SiteDeptRecordTypePtr  recordP;
 Word   pindex;

switch (event->eType)

{
   case nilEvent:
    LoginFormUpdateTime ();
  LoginFormUpdateDate ();
  handled= true;    // handled
     break;

   case ctlSelectEvent:
   switch (event->data.ctlEnter.controlID)

   {
  case frmOpenEvent:

       FrmDrawForm(FrmGetActiveForm());
       LoginFormForceDrawForm ();

//The following code is to display the site and department
//at login screen kind stuff

       recordH = DmQueryRecord(SiteDB, 0);
       recordP =(SiteDeptRecordTypePtr)MemHandleLock(recordH);

       StrCopy(title, recordP->siteLookup);
       StrCat(title, "  ");
       StrCat(title, recordP->deptLookup);

       FrmSetTitle(frm, title);

       MemHandleUnlock(recordH);
/*The code section which comment out displays "Hello (:-" + PalmPilot's user
*/

       if(focus!=0)
       {
          FrmSetFocus(frm, FrmGetObjectIndex(frm,
DataCollectorLoginPasswordFieldField));
       }
       else
       {
         pindex=FrmGetObjectIndex(frm, DataCollectorLoginIDFieldField);
          FrmSetFocus(frm, pindex);
       }
       handled=true;
       break;

  case frmCloseEvent:
      frm=FrmGetActiveForm();
       focus=0;
      // PreviousView=DataCollectorLoginForm;
       break;
   }
 return(handled);
}



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