static BOOL PASCAL GetStatus( LPCTSTR lpszFileName, CFileStatus& rStatus );If this function succeed, then the file exists.

解决方案 »

  1.   

    static BOOL PASCAL GetStatus( LPCTSTR lpszFileName, CFileStatus& rStatus );能否用代码解释一下,我在程序中试了一下,出错。
      

  2.   

    use the function :
       int _access( const char *path, int mode );
    for example:char* path = "C:\\mydir\\myfile.txt";
    int mode = 0;if ( _access( path, mode ) != -1 ) 
    {
        CString cs;
        cs.Format("%s has exist!",path);
        MessageBox(cs);
    }
      

  3.   

    sorry,should be CFile::GetStatus(...)
      

  4.   

    用CFileFind类的FindFile函数,如果该文件存在,返回true,否则返回false