Some please Help haveing proplem with code below....
zen, i have been on same kind of stuff, i am not sure if this can help you
but it sort of does the job for me, it print all table record into CTRLIST
There are few thing that i am not sure off... and i cannot convert one
of my table field, which is a text field. Not sure how they do that..
Can soneone please help, i am trying to pass a Text field to my static
data for list. get error
"cannot convert from 'class CString' to 'char *' "
and this program shows all the records in my table, where am i going wrong
it looks like my if statement's not functioning....
TableSet recSet(pDb);
int recCount=0; // get record count test purpose
char pInSk[10]; //did not work without 10
char pOtSk[10]; // id not work without 10
int nNum = 1; // for number greater than
for( recSet.Open(); !recSet.IsEOF(); recSet.MoveNext() )
{
// only show records that has number more than 1
if (recSet.m_POn >= nNum)
recCount ++;
// Data conversion Lon to Char not sure why there is 10 at the end
// ***** Cannot convert CString to Char **********
_itoa( recSet.m_PInSok, pInSk, 10 );
_itoa( recSet.m_POnOd, pOtSk, 10 );
static _TCHAR *_Item[NUM_ITEMS][NUM_COLUMNS] =
{
"test",pInSk,pOtSk // get table data
};
// write to list
LV_ITEM lvi;
for(i = 0; i < NUM_ITEMS; i++)
{ lvi.mask = LVIF_TEXT;
lvi.iItem = i;
lvi.iSubItem = 0;
lvi.pszText = _Item[0];
int nItem = m_showList.InsertItem(i,_Item[0]);
ASSERT(nItem!=-1);
m_showList.SetItemText(nItem,1,_Item[1]);
m_showList.SetItemText(nItem,2,_Item[2]);
}