Hi,
I am new to palm programming.
I have created a form with a button. After clicking this button  i am reading a 
database and getting the first record from it.

I get this error--
Starter(1.0) called SysFatalAlert with the message "MemoryMgr.c,Line 4340, NULL handle"

code...
case frmViewCmdFirstButton:    
     memH = (MemHandle)DmQueryRecord(db,0);
     recP = (DBRecordTypePtr)MemHandleLock(memH);
     SetField(FrmViewForm,frmViewTxtNameField,recP->data);          
     MemHandleUnlock(memH);
     MemHandleUnlock(h);     
     DmReleaseRecord(db,1,false);
break;

SetField ()---

static FieldPtr SetField(UInt16 formID, UInt16 fieldID,MemPtr str)
{
 FormPtr frm;
 FieldPtr fld;
 UInt16 obj; 
 MemHandle h;
 Char *p;
 
 frm = FrmGetFormPtr(formID);
 obj = FrmGetObjectIndex(frm,fieldID);
 fld = (FieldPtr)FrmGetObjectPtr(frm,obj); 
 h = (MemHandle)FldGetTextHandle(fld); 
 p = (Char*)MemHandleLock(h);// this line gives the error
 StrCopy(p, (Char*)str);
 MemHandleUnlock(h); 
 FldSetTextHandle(fld,h);
}

Basically i want to retrieve records form a database and place them in the appropriate 
text fields. How do i proceed.

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

Reply via email to