Reading and Writing from the file were easier for me but i am unable to do it in SDI Application (MFC) .... i need some guidance to solve this .......... here is constructor
CFileDoc::CFileDoc()
{
// TODO: add one-time construction code here
CFileDialog m_IdFile(true);
if(m_IdFile.DoModal()==IDOK)
m_sFileName= m_IdFile.GetFileName();
fstream outFile;
string data;
outFile.open(m_sFileName,ios::in);
{
while(outFile.eof()!=true)
{
getline(outFile,data);
m_sName=data;
}
}
outFile.close();
}
i am doing mistake in this part
m_sName=data;
because the Data type of m_sName is CString and the data type of data is string
CString m_sName;
string data;
the error is
binary '=' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable conversion)