how can i pass data into the edit box using the code below??

CString tmpBuf;
POSITION pos= m_OrderList.GetFirstSelectedItemPosition();
int sel=m_OrderList.GetNextSelectedItem(pos);
tmpBuf=m_OrderList.GetItemText(sel, 0);
//GetDlgItem(IDC_ORDERNO)->SetWindowText(buf);

tmpBuf=m_OrderList.GetItemText(sel, 1);
tmpBuf.TrimRight();
//GetDlgItem(IDC_DAY)->SetWindowText(tmpBuf);

// TODO: Add your control notification handler code here
EndDialog(100);
Order1 link_To_Order;
link_To_Order.DoModal();
}

when i include the code below, the run-time error occur

GetDlgItem(IDC_DAY)->SetWindowText(tmpBuf);

how can i add the IDC_ORDERNO from another into the current class?
the m_OrderList is the variable foir my list control

hope someone can help me, if not clear abt my problems, u may e-mail me at thcc2@yahoo.co.uk