如题

解决方案 »

  1.   

    extern char* pOldName;
    extern char* pNewName;
    TRY
    {
        CFile::Rename( pOldName, pNewName );
    }
    CATCH( CFileException, e )
    {
        #ifdef _DEBUG
            afxDump << "File " << pOldName << " not found, cause = "
                << e->m_cause << "\n";
        #endif
    }
    END_CATCHCFile Overview |  Class Members
      

  2.   

    用WinExec加dos命令最简单。WinExec("raname name1 name2",SW_HIDE);
      

  3.   

    谢谢,不过我还想知道有没有用于改文件名的 WIN32 API 函数。
    CFile::Rename 好象调用是 rename , 但不是win32api