Greetings all,
I hope your New Years went well.

I have written code to dynamically draw text and remove that text when the page 
is changed. However after a few page changes I will get this error:
-----------------------------
TestGen (unknown version) called SysFatalAlert with the message: "MemoryMgr.c, 
Line:3061, Chunk over-locked".
-----------------------------
The cause of this is the creation of the text as if I don't draw any text and 
just show the dyamic textbox (also part of my program) then page turning is 
fine.

At first I thought it was a glitch in using dynamic UI (lblNewLabel). So I 
changed it to using winDrawChars and winEraseChars but to my surprise it still 
shows up.

Here is my code:
----------------------------
                        if(type == labelType)
                        {
                                DBRecordLabelPtr lbP;
                                //FormLabelType *frmLabel;
                                
                                lbP = (DBRecordLabelPtr)MemHandleLock(tbH);
                                /*
                                frmLabel = FrmNewLabel(&frm, 
lastID++,lbP->Text,string2int(lbP->X),
                                                                
string2int(lbP->Y), stdFont);
                                FrmDrawForm(frm);
                                */
                                WinDrawChars (
                                   lbP->Text,
                                        strlen(lbP->Text),
                                        string2int(lbP->X),
                                        string2int(lbP->Y)
                                );
                                FrmSetEventHandler(frm, MainFormHandleEvent);
                        }
------------------------------
As you can see it is using a database to read the details for the label. My old 
implementation has been commented out.

Here is how I remove the text:
-------------------------------
if(type == labelType)
                        {
                                DBRecordLabelPtr lbP;
                                
                                lbP = (DBRecordLabelPtr)MemHandleLock(tbH);
                                WinEraseChars (
                                   lbP->Text,
                                        strlen(lbP->Text),
                                        string2int(lbP->X),
                                        string2int(lbP->Y)
                                );
                                FrmSetEventHandler(frm, MainFormHandleEvent);
                        }
-----------------------------

For my first implentation it was removed with the other dynamic controls with 
this piece of code:
-----------------------------
        for (i = initID; i < lastID; i++)
        {
                FrmHideObject(frmPtr,FrmGetObjectIndex(frmPtr, i));
                FrmRemoveObject(&frmPtr,FrmGetObjectIndex(frmPtr, i));
        }
------------------------------

I hope someone can help me.

Thanks for your time
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to