I have some problems with the dynamic creation of fields. 
The program has to use this function intensively.
I create and show the fields like
that:
-----
pFld=FldNewField(&pFrm,nId,nKoordX,nKoordY,nWidth,nHeight,font,255,true,grayUn
derline,true,false,leftAlign,true,false,false);
pFld = (FieldType *) FrmGetObjectPtr(pFrm,FrmGetObjectIndex(pFrm,nId));
FldDrawField(pFld);
-----
and destroy them like that:
-----
pFld = (FieldType *) FrmGetObjectPtr(pFrm,FrmGetObjectIndex(pFrm,nId));
FldEraseField(pFld);
pFld = (FieldType *) FrmGetObjectPtr(pFrm,FrmGetObjectIndex(pFrm,nId));
FldFreeMemory(pFld);
nIndex=FrmGetObjectIndex(pFrm,nId);
FrmRemoveObject(&pFrm,nIndex);
-----
There are sometimes errors when I simply click on a field.
Is there something wrong with the routines?

I know that Neil Rhodes, the author of 'Palm Programming', had problems with
these dynamically created fields, too. But he knows no solution.
And I have read a earlier posting that you should avoid dynamically created
objects by all means, because of the bug in PrvFixupPointers().
But I don't know if this is the cause of the errors.

I should be very grateful if you would help me out with some advice.

A.Schlosser



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