Hello everyone!
I have created an editable list control (report style) with numbers. I want to save the content in a text file (each number below the other) and I used
void CDataDialog::OnBnClickedOk()
{
CStdioFile file("test.txt", CFile::modeCreate);
int nCount = m_List.GetItemCount();//m_List is control variable declared about list control
for (int x = 0; x < nCount; x++)
{
CString strText = m_List.GetItemText(x, 0); // first column
file.WriteString(strText);
}
file.Close();
}
but although it is compiled, it crashes. Could someone help please?