CFile怎么一行一行读取文件?

CFile pfile(fileDlg.GetFileName(),CFile::modeRead);
char* pBuf;
DWORD dwFileLen;
dwFileLen = pfile.GetLength();
pBuf=new char[dwFileLen+1];
pBuf[dwFileLen]=0;
pfile.Read(pBuf,dwFileLen);
MessageBox(pBuf);
pfile.Close();

求各位大神帮忙解决一个问题··我现在用的是vs2010的mfc··现在只是实现了能用Messagebox来查看txt中的内容··但我想要一行一行读取txt中的文件(一共20来行,每一行一个小数),然后按照顺序输入到子窗口的各个EditBox中··应该怎么做呢?

用ifstream就可以了

http://blog.sina.com.cn/s/blog_8d3a834d01015fd8.html

cstdiofile writestrimg 可以一次读一行

用ifstream就可以了

http://blog.sina.com.cn/s/blog_8d3a834d01015fd8.html