CString m_strPath, str;

CStdioFile rFile;

CFileException ex;

CFileDialog dlg(TRUE, _T("*.txt"), NULL, OFN_FILEMUSTEXIST | OFN_OVERWRITEPROMPT, _T("TXT Files(*.txt)|*.txt|"), NULL);

if (dlg.DoModal() == IDOK)

{

     m_strPath = dlg.GetPathName();

     rFile.Open(m_strPath, CFile::modeReadWrite | CFile::typeText, &ex);

while (rFile.ReadString(str))

{

     getFileString += (str + _T("\r\n"));

}

rFile.Close();

 

// edit control에 txt파일 쓰기

mFileView.SetWindowTextW(getFileString);

}

+ Recent posts