After Searching a lot i got my solution and it is like this.
1) Take CArray.
i have created a CSave class from CObject.
In the header file i have to declare like this.
class CSave : public CObject
{
public:
CSave();
CSave(CSave &item);
CSave &operator =(CSave &item);
virtual ~CSave();
public:
CString str[120];
}
2) In the source file(.cpp) declare like this
CSave::CSave(CSave &item)
{
int j=0;
for(int Row=0;Row<20;Row++)
{
for(int Col=0;Col<6;Col++,j++)
{
str[j]=item.str[j];
}
}
}
3) For Serialization do like this
void CSave::Serialize(CArchive& ar)
{
CObject::Serialize(ar);
if( ar.IsStoring() )
{
int j=0;
for(int Row=0;Row<20;Row++)
{
for(int Col=0;Col<6;Col++,j++)
{
ar<<str[j];
}
}
}
else
{
int j=0;
for(int Row=0;Row<20;Row++)
{
for(int Col=0;Col<6;Col++,j++)
{
ar>>str[j];
}
}
}
}
4)In the dialog source file (.cpp) add this for adding data to serialization....
CSave itm;
int j=0;
for(int Row=0;Row<20;Row++)
{
for(int Col=0;Col<6;Col++,j++)
{
itm.str[j]=m_lstDemo.GetItemText(Row,Col);
}
}
CSave *item = new CSave(itm);
ListOfData.Add(item);
5) For Reading data back ..
CSave *itm=reinterpret_cast<CSave *>(ListOfData[0]);
int j=0;
for(int Row=0;Row<20;Row++)
{
for(int Col=0;Col<6;Col++,j++)
{
m_lstDemo.SetItemText(Row,Col,itm->str[j]);
}
}
That's it...