| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| New on Forum Join Date: Oct 2003
Posts: 8
| burning directories with NeroAPI Hi, I try to burn a directory (incl. content and subdirectories) using NeroAPI. I used the sample NeroFiddles, but I could'nt do that. The OnBrowse-function in the NeroFiddles can select files (not directories). I wrote a funtion to select the directories, but the OnBurn-function does'nt work with the returned value. can somebody help me? ![]() |
| | |
| | #2 (permalink) |
| New on Forum Join Date: Oct 2003 Location: Germany
Posts: 11
| Hi, have a look at my post (directly under yours) with the title Multisession, Folder-Creation with NeroAPI. For each file and folder, you've to create a NERO_ISO_ITEM with a pointer to the next NERO_ISO_ITEM (nextItem, or firstSubDirectoryItem). That means file one's Item-Struct points to the struct of file two, the struct of file two points to the struct of file three and so on. If there are more questions, post again. |
| | |
| | #4 (permalink) |
| New on Forum Join Date: Oct 2003 Location: Germany
Posts: 11
| Hi zavoshi, you have to create an Iso-Item for each Directory and for each file (even those in the directories). If you have the directory-struct like c:\\Burn\\FolderA\\File1 c:\\Burn\\FolderA\\File2 c:\\Burn\\FolderB\\File3 c:\\Burn\\File4 and you want to burn the content of folder Burn, the first IsoItem has to be filled with FolderA ->fileName= "FolderA" (use strcpy) ->sourceFilePath= "" (use strcpy) ->isDirectory= TRUE ->subDirFirstItem= (Pointer to IsoItem struct of 'File1') ->nextItem= (Pointer to IsoItem-struct of 'FolderB') File1 ->fileName= "File1" (use strcpy) ->sourceFilePath= "c:\\Burn\\FolderA\\File1" (use strcpy) ->isDirectory= FALSE ->subDirFirstItem= NULL ->nextItem= (Pointer to IsoItem of File2) ... File4 ->fileName= "File4" (use strcpy) ->sourceFilePath= "c:\\Burn\\File4" (use strcpy) ->isDirectory= FALSE ->nextItem= NULL ->subDirFirstItem= NULL create each IsoItem like this; Code: NERO_ISO_ITEM* pItem; pItem= NeroCreateIsoItem(); after burning, free the memory with Code: NeroFreeIsoItemTree(...) I hope this helps, greetings Tim |
| | |
| | #5 (permalink) |
| New on Forum Join Date: Oct 2003
Posts: 8
| Hi TimS, thanks a lot. you are a great help. But I want to burn a directory and I don't know the content. User must select the directory and the application shall burn the content on a CD. Do you understand my problem. I don't Know the subdirectories and their content. greetings zavoshi |
| | |
| | #6 (permalink) |
| New on Forum Join Date: Oct 2003 Location: Germany
Posts: 11
| Hello zavoshi, I think, you've to find out, which files are in the selected directory, maybe like this: Code: CFileFind cffFile;
cffFile.FindFile("c:\\test\\*.*");
while(cffFile.FindNextFile())
{
CString cstrFile;
cstrFile= cffFile.GetFilePath();
// and now put this file into the list
// for your NeroIsoItems
} I think there are some more difficults. If you, or somebody else here, knows a better way, please post it. thank you, and have a nice weekend, greetings, Tim |
| | |
| | #8 (permalink) |
| New on Forum Join Date: Oct 2003
Posts: 8
| Hi TimS, enter this Code to the OnBrowse() Function an so can you select a directory: Code: -------------------------------------------------------------- { static char BASED_CODE szFilter[] = "All Files (*.*)|*.*"; BROWSEINFO bi = {0}; TCHAR path[255]; LPITEMIDLIST pidl=SHBrowseForFolder(&bi); if (pidl !=0 ) { if (SHGetPathFromIDList(pidl,path)) { mstrPathName = path; medtFileName.SetWindowText(mstrPathName); MessageBox(path); if (pndiDeviceInfos->nsdisNumDevInfos > 0) { mbtnBurn.EnableWindow(true); } } } } --------------------------------------------------------------- Have a nice weekend. |
| | |
| | #10 (permalink) |
| New on Forum Join Date: Oct 2003 Location: Germany
Posts: 11
| Hello Zavoshi, I didn't try your directory-selection, because in my running project, there's no need for it. I asked you, because I'll maybe need it at another corner. I've got a list with all files to burn. You can use this function, to find out all files in a given directory: Code: // puts all files in the given directory (strPfad) into the filelist of m_Burn
void CreateFilelist(string strPfad)
{
char* pszTemp;
pszTemp= new char [512 +1];
strnset(pszTemp, '\0', 512);
sprintf(pszTemp, "%s\\*.*", strPfad.c_str());
BOOL bFileExists;
CFileFind cffFile;
bFileExists= cffFile.FindFile(pszTemp, 0);
while(bFileExists)
{
bFileExists= cffFile.FindNextFile();
if(!cffFile.IsDots())
{
if(cffFile.IsDirectory())
{
// another directory
CString cstrName, cstrPfad;
cstrName= cffFile.GetFileName();
cstrPfad= cffFile.GetFilePath();
m_Burn.AddOrdner((LPCTSTR) cstrName);
CreateFilelist((LPCTSTR) cstrPfad);
m_Burn.CloseOrdner();
}
else
{
CString cstrName, cstrPfad;
cstrName= cffFile.GetFileName();
cstrPfad= cffFile.GetFilePath();
m_Burn.AddFile((LPCTSTR) cstrName, (LPCTSTR) cstrPfad);
}
}
}
cffFile.Close();
delete [] pszTemp;
return;
} Each file is put into a list (member of class CBurn) The second function creates an NeroIsoItem for each entry in this list and is a recursiv member-function of the class CBurn Code: NERO_ISO_ITEM* CBurn::CreateISOTree(ITLISTDAT& itDat)
{
if(itDat == m_lstdatFiles.end())
{
// no more entry in the list
return NULL;
}
NERO_ISO_ITEM* pniiThisItem;
pniiThisItem= NULL;
pniiThisItem= NeroCreateIsoItem();
strcpy(pniiThisItem->fileName, (*itDat).strName.c_str());
strcpy(pniiThisItem->sourceFilePath, (*itDat).strPfad.c_str());
pniiThisItem->isDirectory= FALSE;
pniiThisItem->isReference= FALSE;
pniiThisItem->nextItem= CreateISOTree(++itDat); // recursive call
pniiThisItem->subDirFirstItem= NULL;
return pniiThisItem;
} DATEI are defined: Code: typedef struct tag_DATEI
{
string strName;
string strPfad;
} DATEI;
typedef list Code: NERO_ISO_ITEM* pniiFile; pniiFile= ISOTreeErstellen(m_lstdatFiles.begin()); I hope, that helps, greetings, Tim Last edited by TimS; 28-10-2003 at 08:41. |
| | |
| | #13 (permalink) |
| New on Forum Join Date: Oct 2003
Posts: 8
| Hi TimS, thank you, but I don't understand it, because I don't no the relationship between the classes. You sent me a part of your code and it is difficult to understand, how you defined your classes. (PS: I come also from Germany and we could write in german.) thanks |
| | |
| |
| |
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NeroAPI crashes burning a DVD | Rupella | Nero SDK Discussion Forum | 1 | 21-04-2006 16:58 |
| Burning directories and file Recursive | zikman | Nero SDK Discussion Forum | 1 | 12-07-2005 07:22 |
| NeroCMD: burning multiple directories/files | burning snow | Nero SDK Discussion Forum | 9 | 24-08-2004 23:03 |
| Burning directories | rcortes | Nero SDK Discussion Forum | 3 | 23-10-2003 10:12 |
| Burning DVD-Video with NeroAPI | VPCoder | Nero SDK Discussion Forum | 3 | 24-06-2003 13:46 |