I am trying to create a dynamic list and am going off of the example show in
the "Palm OS Programming Bible". Below is my code (essentially the example in
the book) but I get the following errors:
(1) passing arg 2 of `LstSetDrawFunction' from incompatible pointer type
(2) `ListElements' undeclared (first use in this function)
Note: For now, I have a static list. I wanted to do one step at a time.
---------------------------------------------------------------------------------------------------------------------------------
static Boolean LoadFileNameFormHandleEvent(EventType* pEvent)
{
FormType* pForm;
ListType* listP = GetObjectPtr(1005);
UInt8 numChoices = 0;
UInt16 counter;
char ListElements[5][10] =
{
{ "350Z_04" },
{ "Titan_04" },
{ "RF_Hummer" },
{ "Audi_99" },
{ "BMW_M5_04"}
};
OemiDBRecordType *CarPtr;
OemiDBRecordType Car;
MemHandle recordH;
WriteNumberToField(DmNumRecords(OemDB), 1003); // shows the number of
records in the database
LstSetDrawFunction(listP, DrawLoadFileList);
<-------------------------(1)
numChoices = sizeof(ListElements)/sizeof(ListElements[0]);
LstSetChoices(listP, NULL, numChoices);
FrmDrawForm(FrmGetActiveForm());
}
static void DrawLoadFileList(UInt16 itemNum, RectangleType *bounds, Char
**itemsText)
{
WinDrawChars( ListElements[itemNum],
<---------------------(2)
StrLen(ListElements[itemNum]),
bounds->topLeft.x,
bounds->topLeft.y);
}
---------------------------------------------------------------------------------------------------------------------------------
thanks in advance!
~Tony
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/