各位高人:
   用nero的开发包编写刻录程序,在连续刻录的时候只能刻录文件,不能刻录文件夹,怎么就可以把文件夹刻录上去?哪位有这方面的经验,指点一下,谢谢!

解决方案 »

  1.   

    NERO_ISO_ITEM *NeroBuildIsoTreeFromPath( LPCTSTR lpszStartPath )
    {
    NERO_ISO_ITEM *pIsoItem = NULL;
    NERO_ISO_ITEM *pPreviousIsoItem = NULL;
    CFileFind finder;    CString strWildcard(lpszStartPath);
        strWildcard += _T("\\*.*");
        BOOL bWorking =finder.FindFile(strWildcard); while( bWorking )
    { bWorking = finder.FindNextFile(); if (finder.IsDots())
    continue; pIsoItem = NeroCreateIsoItem(); // will be freed by NeroFreeIsoItemTree
    lstrcpyn( pIsoItem->fileName, finder.GetFileName(), 251 );
    lstrcpyn( pIsoItem->sourceFilePath, finder.GetFilePath(), 251 );
    pIsoItem->isDirectory=finder.IsDirectory();
    pIsoItem->isReference=FALSE;
    // collecting the items backwards was easier to code
    pIsoItem->nextItem = pPreviousIsoItem;
    pPreviousIsoItem = pIsoItem;
    if ( finder.IsDirectory() )
    pIsoItem->subDirFirstItem = NeroBuildIsoTreeFromPath( finder.GetFilePath() );
    } finder.Close(); return pIsoItem;
    }在刻录函数里面加上下面的代码:
                      niiTemp2=NeroCreateIsoItem(); //NERO_ISO_ITEM *niiTemp2;
    if(SingleFile)//刻单个文件
    {    
       strcpy(niiTemp2->fileName, mstrFileName); 
       strcpy(niiTemp2->sourceFilePath, mstrPathName);
       niiTemp2->isDirectory=FALSE;
       niiTemp2->isReference=FALSE;
           niiTemp2->nextItem=NULL;
    }
    else//刻目录     
      niiTemp2 = NeroBuildIsoTreeFromPath((LPCTSTR)mstrPathName);