Go Back   Club CDFreaks - Knowledge is Power > International Chat: Software related > Nero SDK Discussion Forum


Commercial message



Nero SDK Discussion Forum Discuss, urgent: folder iso tree at International Chat: Software related forum; Can anybody please help me with a WORKING function for Visual C++6, and not sending me to NeroCmd or anything like this? I am trying to add a folder with its files/subfolders to the compilation. Can anybody provide me the function that fills the whole structure of NERO_ISO_ITEMs?


Reply
 
Thread Tools
Old 20-04-2005   #1 (permalink)
phm
New on Forum
 
Join Date: Apr 2005
Posts: 6
urgent: folder iso tree

Can anybody please help me with a WORKING function for Visual C++6, and not sending me to NeroCmd or anything like this?

I am trying to add a folder with its files/subfolders to the compilation.
Can anybody provide me the function that fills the whole structure of NERO_ISO_ITEMs?

Thanks in advance
Gabriel
phm is offline   Reply With Quote
Old 22-04-2005   #2 (permalink)
New on Forum
 
Join Date: Mar 2005
Posts: 10
Re: urgent: folder iso tree

Hi.

This is for creating a DVD, but it shows the basics anyway.

Code:
int main()
{
... NeroInit stuff...
	NERO_WRITE_CD *write_cd = NULL;
... create your write_cd
	GetIsoTrack( &write_cd->nwcdIsoTrack );
... NeroBurn stuff ...
}

int GetIsoTrack( CNeroIsoTrack** ppIsoTrack)
{
	*ppIsoTrack = NULL;
	NERO_ISO_ITEM* pItem = NULL;
	if( CreateIsoTree( "A:\\Path\\To\\Your\\Files\\*.*", &pItem ) ) {
		cerr << "Error: CreateIsoTree()." << endl;
		return 1;
	}

	DWORD dwFlags = NCITEF_USE_JOLIET | NCITEF_CREATE_ISO_FS | NCITEF_CREATE_UDF_FS |
		NCITEF_DVDVIDEO_REALLOC | NCITEF_DVDVIDEO_CMPT;
	NERO_CITE_ARGS citeArgs;
	memset (&citeArgs, 0, sizeof (citeArgs));
	citeArgs.dwBurnOptions = dwFlags;
	citeArgs.name = "";
	citeArgs.firstRootItem = pItem;
	citeArgs.abstract = "";
	citeArgs.application = "";
	citeArgs.bibliographic = "";
	citeArgs.copyright = "";
	citeArgs.dataPreparer = "";
	citeArgs.publisher = "";
	citeArgs.systemIdentifier = "";
	citeArgs.volumeSet = "";
	// Finally, create the ISO track.
	*ppIsoTrack = NeroCreateIsoTrackEx (NULL, (const char *) &citeArgs, NCITEF_USE_STRUCT);
	if( NULL == *ppIsoTrack ) {
		cerr << "Error: NeroCreateIsoTrackEx()." << endl;
		return 1;
	}
	return 0;
}

// This is from a separate CPP
#include "stdafx.h"

#include < iostream >
#include < io.h >
#include < time.h >

using namespace std;

// Current time is static so we don't have to construct it all the time
static struct tm *date = NULL;

int CreateIsoTree( const string &Dir, NERO_ISO_ITEM **Root_item )
{
	intptr_t file_handle;
	struct _finddata_t rec;
	string path = Dir.substr( 0, Dir.rfind( "\\" ) +1 );
	string s;
	NERO_ISO_ITEM *new_item = NULL;

	if( NULL == date ) {
		time_t t;
		time( &t );
		date = localtime( &t );
	}
	
	file_handle = _findfirst( Dir.c_str(), &rec );
	if( -1 == file_handle )
		return 1;          // invalid path
	do {
		s = rec.name;
		if( ( "." == s ) || ( ".." == s ) )
			continue;
		s = path + s;

		new_item = NeroCreateIsoItem();
		if( NULL == new_item )
			return 2;
		new_item->entryTime = *date;
		strcpy( new_item->fileName, rec.name );
		strcpy( new_item->sourceFilePath, s.c_str() );
		if( NULL != *Root_item ) 
			new_item->nextItem = *Root_item; // easier and faster to add to the beginning
		*Root_item = new_item;
		
		if( rec.attrib & _A_SUBDIR ) {
			// Directory
			new_item->isDirectory = 1;
			CreateIsoTree( s + "\\*.*", &new_item->subDirFirstItem );
		}
	} while( 0 == _findnext( file_handle, &rec ) );
	_findclose( file_handle );
	return 0;
}
Hope this helps.
Creosote is offline   Reply With Quote
Old 22-04-2005   #3 (permalink)
phm
New on Forum
 
Join Date: Apr 2005
Posts: 6
Re: urgent: folder iso tree

Thank you very much.
Hope it will work.
phm is offline   Reply With Quote
 
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create iso of folder to hard drive Heffy Newbie Forum 8 31-12-2006 03:42
video-ts folder to ISO or IMG MegaDETH Video Edit Software 7 25-11-2006 22:33
Add Catagory folder to iso Track ernier Nero SDK Discussion Forum 0 23-01-2006 13:09
Add Folder or File to ISO ??? Yotofuji General Software 3 15-07-2005 10:40
Can i turn all the file sin the 'VIDEO_TS' folder to IMG or ISO? bigjimmbow Newbie Forum 1 27-05-2005 04:46


All times are GMT +2. The time now is 20:43.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0