Hi, I have struggled with this problem quite a while, but still cannot
figure out. Wish I can get some help from here.

I am doing a very simple simple popup list which is associated with a
trigger control. Well, when I click the trigger, the program popup the
list successfully. Whereas, whenever I click inside the list by
mouse(I am using simulator), it crashes the system and gives the error
message like that,
 Unhandled exception in thread STRT:main at 0x57F90D25 in uilib_4.dll.
The simulation can not continue.

It works normally, if I click outside the list. 
Also, I can navegate the list if I am using the up and down arrow key
of keyboard. And it won't crash the system.
It just cannot click inside the list.

The list content is dynamically taken from schema database.

And below I paste my codes,
In form open event call back function, I set list draw function like that.
=================================================
ListType *pList;
        uint32_t numRows;
        
        pList = FrmGetObjectPtr(pForm, FrmGetObjectIndex(pForm,
AlbumDeleteFormAlbumList));
        LstSetDrawFunction(pList, AlbumDeleteFormDrawListItem);
        numRows = DbCursorGetRowCount(gCursor);
        LstSetListChoices(pList, NULL, (int16_t)numRows);
        

In draw list call back function, 
==================================================
static void AlbumDeleteFormDrawListItem(int16_t itemNum, RectangleType *pRect,
                                                                           char 
**unused, struct ListType *pList)
{
        status_t        err = errNone;
        char nameP[25];
        uint16_t owner;
        void *valueP1, *valueP2;
        uint32_t valueSize1, valueSize2;
        uint32_t        rowID;
        
        // -----Get row ID for current position (cursor is 1=based, list is 
0-based)
        err = DbCursorGetRowIDForPosition(gCursor, itemNum + 1, &rowID);
        if (err < 0)
                return;

               //get owner type column value
        err = DbGetColumnValue(gDataDB, rowID, kAlbumOwnerColID, 0, &valueP2,
&valueSize2);
        if (errNone == err)
                owner = *(uint16_t *)valueP2;
        else
                return;
        
               //get album name column value & draw name
        err = DbGetColumnValue(gDataDB, rowID, kAlbumNameColID, 0, &valueP1,
&valueSize1);
        if (errNone == err){
                memcpy(nameP, valueP1, valueSize1);
        } else {
                ErrDisplay("Error in retrieving column album name value");
                return;
        }

        DbReleaseStorage(gDataDB, valueP1);
        DbReleaseStorage(gDataDB, valueP2);


        //draw
        WinDrawChars(nameP, strlen(nameP), pRect->topLeft.x, pRect->topLeft.y);
}

==========================================================
I am using almost the same codes to write table(UI table, not the
database table) call back functions. The same way to retrieve database
columns, allocate and release memory..., only made very little
modification.
But, why my popup list crashes the system whereas the table works fine.

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

Reply via email to