Hi,
i'm having problem with memoryhandle --- i 'm
displaying data in a table and i 'm
using customloadroutine to display text data and to
populate the data i 'm calling a
separate function where i'm using following code -
for(column=0;column<kNumTextColumns;column++)
for(row1=0; row1<kNumRows;row1++)
{
row = row1 + TopVisibleNo;
if (row >=ListNumLimit1) continue;
{
// populate the data -lists
if(column==0)
textPtr = mydata1[row];
else if(column==1)
{
textPtr = mydata2[row];
}
else if(column==2)
{
textPtr = mydata3[row];
}
gHandles[column][row1] =
MemHandleNew(StrLen(textPtr)+1);
if(!gHandles[column][row1]) return;
s = MemHandleLock(gHandles[column][row1]);
StrCopy(s, textPtr);
MemHandleUnlock(gHandles[column][row1]);
}
}
--it's working fine -it's displaying the first set of
data --now i have to display second
set of data in the same table on same form -- to do
this i'm using same Table-initialization
function and the customloadroutine but using diff
function to populate the data as
follows->
for(column=0;column<kNumTextColumns;column++)
for(row1=0; row1<kNumRows;row1++)
{
row = row1 + TopVisibleNo;
if (row >=ListNumLimit2) continue;
{
if(column==0)
textPtr = mydata_Second_Set1[row];
else if(column==1)
{
textPtr = mydata_Second_Set2[row];
}
else if(column==2)
{
textPtr = mydata_Second_Set3[row];
}
gHandles[column][row1] =
MemHandleNew(StrLen(textPtr)+1); //ERROR
s = MemHandleLock(gHandles[column][row1]); StrCopy(s,
textPtr); //ERROR
MemHandleUnlock(gHandles[column][row1]);
}
}
here in the 2nd function while allocating mem to
handle it's giving Error(err msg: read from mem
location 0x00037628 which is in Mem Manager data
structure) --
what may be the reason for this??
and i used
errorCode1 = MemHeapCheck(0);
errorCode2 = MemHeapCheck(1);
to Check the dynamic heap after the first display and
both errorcode returning zero.
Can anybody tell me plz where i 'm going wrong??
Thnax in Advance for any help
Pinaki
________________________________________________________________________
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and
more.
Go to: http://in.insurance.yahoo.com/licspecial/index.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/