Hi guys!
I have a project and I have created a dialog box in which I insert data. I tried to save those data in .txt file but when I open the txt I see only symbols and not the values I inserted. Could you help? please? Here is my code:
I have a project and I have created a dialog box in which I insert data. I tried to save those data in .txt file but when I open the txt I see only symbols and not the values I inserted. Could you help? please? Here is my code:
Code:
void CDataDialog::OnBnClickedSaveBtn()
{
// TODO: Add your control notification handler code here
this->UpdateData();
CFile flData;
char strFilter[] = { "Data File(*.txt)|*.txt|All Files(*.*)|*.*||" };
CFileDialog FileDlg(FALSE, CString(".txt"), NULL, 0, CString(strFilter));
if (FileDlg.DoModal() == IDOK)
{
flData.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite) == FALSE;
CArchive ar(&flData, CArchive::store);
ar << m_Dialogresistivity1;
ar << m_Dialogpermeability1;
ar << m_Dialogouter1;
ar<< m_Dialoginner1;
ar<< m_DialogRdc1;
ar<< m_Dialogxcomp1;
ar<< m_Dialogycomp1;
ar.Close();
}
flData.Close();