| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #5 (permalink) |
| New on Forum Join Date: Jul 2005
Posts: 6
| Re: add files and folders I havent done exactly what you guys are looking for, but I can give you all generally what you need. First the recursive function for finding the directories... recursiveFn(string dir) { WIN32_FIND_DATA findData; HANDLE hFind=FindFirstFile((dir+"\\*.*").c_str(), &findData); do { string sFileName(findData.cFileName); //sFileName will contain the name of the file or directory if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) // is a directory //do the directory stuff (recurse etc) else // you know you have a file }while (FindNextFile(hFind, &findData)); } I used somethign like this and stored the results in what was basically a vector of filepaths. For the burning, you will need to create a bunch of NERO_ISO_ITEMS. Its really just a linked list or items. Once you have the data structure that is holding the files and directories that you want to burn, you just need to loop or recurse through the items. As you go along, keep creating new NERO_ISO_ITEMS and fill in the filename and the sourceFilePath for the items. As you iterate through, you need to keep track of 2 or 3 NERO_ISO_ITEMS at once, and this is really the key to building the list. As you create new items, they get attached to the list via setting their previous siblings ->nextItem to them. If the item is a directory, you set the isDirectory part of the NERO_ISO_ITEM to true, and if it has items in it, you add them by setting the subDirFirstItem on the first one, and then just attaching the other files/directories in there using the nextItem field. Keep track of whatever your initial NERO_ISO_ITEM was that you created. After you are done attaching all of the siblings and subdirectories, you need to use something like this: m_DVD.nwcdIsoTrack = NeroCreateIsoTrackEx(m_RootItem, m_sDiscTitle, NCITEF_CREATE_ISO_FS|NCITEF_USE_JOLIET|NCITEF_CREATE_UDF_FS); Where the m_DVD is your NERO_WRITE_CD. Obviously, there is alot of other NERO things that need to be initialized, and settings that have to be set, but you can basically copy and paste almost 100% of that from the NeroFiddles code. |
| | |
| | #6 (permalink) |
| CD Freaks Member Join Date: Mar 2005
Posts: 109
| Re: add files and folders Just a few notes: - FindFirstFile may return INVALID_HANDLE_VALUE - Remember to skip "dots" directories ("." and "..") - The hFind handle must be closed after the while loop, otherwise the NT system will sooner or later close your application. In my personal experience, closing an INVALID_HANDLE_VALUE will extremely slow down the process for whatever reason, so it would be best to "if (hFile != INVALID_HANDLE_VALUE) ::FindClose(hFind);". |
| | |
| |
| |
![]() |
| If you can't find where you are looking for, then become a member and get an answer fast! We have thousands of people online every moment of the day to help you! Click here |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| View/Add hidden files/folders in Nero | g_goyal2000 | Nero & InCD | 11 | 07-08-2007 16:26 |
| Add multiple files to Listbox, then burn the list of files | rdcrumbaker | Nero SDK Discussion Forum | 4 | 23-03-2006 04:19 |
| Can't add VIDEO_TS folders in Nero Express | david_h | Nero & InCD | 6 | 09-01-2006 01:07 |
| Help Add Folders | serjaime78 | Nero SDK Discussion Forum | 0 | 17-10-2005 12:51 |
| Files/Folders in C# | OliverG | Nero SDK Discussion Forum | 1 | 12-01-2005 09:57 |