void CMyFileDlg::OnSave()
{
// TODO: Add your control notification handler code here
if(m_NewColor)
{
//-------------------------------------------------------------
// Writing the New Colors on the file color.dat
//-------------------------------------------------------------
//Creating a storing archive of type CFile / CStdioFile: file
CStdioFile file;
//Opening the file
file.Open("color.dat", CFile::modeCreate | CFile::modeNoTruncate | CFile::modeReadWrite | CFile::typeBinary);
file.SeekToEnd(); // Moving the cursor to the End of the file.
UpdateData(TRUE); // transferring the content of the edit boxes to the variables
//Writing the context of each variable
//file.WriteString(m_IdColor);
//file.WriteString("\b ");
file.WriteString(m_ColorName);
file.WriteString("\n \n");
//Closing the file
file.Close();
UpdateData(FALSE);
AfxMessageBox("Datos guardados correctamente!");
}
}