再问一下就是有没有类封装了CreateDirtory()函数

解决方案 »

  1.   

    CreateFile: The CreateFile function creates or opens a file, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe.
    或者SHCreateDirectory(Windows 2000以上才有)
      

  2.   

    BOOL CParamParser::Afx_MakeDir(CString strDir)
    {
    //先检查一次全路径,节省时间
    if(Afx_FindDir(strDir))
    return TRUE;
    int nStart = 0;
    if (strDir[strDir.GetLength()-1] != _T('\\'))
    strDir += _T("\\");
    while(nStart != -1)
    {
    if(nStart != 0)
    {
    CString strDirTemp = strDir.Left(nStart);
    if (!Afx_FindDir(strDirTemp))
    {
    if (!::CreateDirectory(strDirTemp, NULL))
    return FALSE;
    }
    nStart++;
    }
    nStart = strDir.Find(_T("\\"), nStart);
    }
    return TRUE;
    }
    /************************************************************************/
    /*                                                                      */
    /************************************************************************/
    BOOL CParamParser::Afx_FindDir(CString strDir)
    {
    if (_waccess((LPCTSTR)strDir, 0) == 0)
    {
    return TRUE;
    }
    return FALSE;
    }