照着vc++6.0的例子在studio2005下却总报错。
如下:
char* pFileName="xingli_Kepler.txt";
CStdioFile f1;
if(!f1.Open("xingli_Kepler.txt",CFile::modeRead|CFile::typeText))
{
#ifdef _DEBUG
afxDump<<"Unable to open file"<<"\n";
#endif
//exit(1);}
char buf[8];
CString rString;
LPTSTR lpstr=f1.ReadString(buf,8);
while(f1.ReadString(rString));
//关闭文件
f1.Close();
///////////////////////////////////////////////////////////////////////////
报错,显示
cannot convert parameter 1 from 'const char [18]' to 'LPCTSTR'
不懂了,哪位高手解释下如何解决?
PS:改为_T("xingli_Kepler.txt")后,第一个错就没有了。
可是f1.ReadString(_T(buf),8)就还是有错了。
如下:
char* pFileName="xingli_Kepler.txt";
CStdioFile f1;
if(!f1.Open("xingli_Kepler.txt",CFile::modeRead|CFile::typeText))
{
#ifdef _DEBUG
afxDump<<"Unable to open file"<<"\n";
#endif
//exit(1);}
char buf[8];
CString rString;
LPTSTR lpstr=f1.ReadString(buf,8);
while(f1.ReadString(rString));
//关闭文件
f1.Close();
///////////////////////////////////////////////////////////////////////////
报错,显示
cannot convert parameter 1 from 'const char [18]' to 'LPCTSTR'
不懂了,哪位高手解释下如何解决?
PS:改为_T("xingli_Kepler.txt")后,第一个错就没有了。
可是f1.ReadString(_T(buf),8)就还是有错了。
报错:'tchar' : undeclared identifier
LPTSTR lpstr=f1.ReadString(buf,8);就不知道怎么改了?