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


Commercial message



Nero SDK Discussion Forum Discuss, NeroAPI / Burning isolated files in a directory specific to each session at International Chat: Software related forum; Hi everyone! I have different 4 files that are localized on different computers or directories. Each time I burn these files (they change), I would like to burn them in a directory on the CD. This directory could represent a session, with the different files in. And I would like


Reply
 
Thread Tools
Old 10-05-2005   #1 (permalink)
New on Forum
 
Join Date: Apr 2005
Posts: 11
NeroAPI / Burning isolated files in a directory specific to each session

Hi everyone!

I have different 4 files that are localized on different computers or directories.
Each time I burn these files (they change), I would like to burn them in a directory on the CD. This directory could represent a session, with the different files in. And I would like to change this director name at each session of course...

Did you already done this ?
How can I do this ?

Thanks in advance for your help!
fpa2 is offline   Reply With Quote
Old 11-05-2005   #2 (permalink)
CD Freaks Member
 
Join Date: Dec 2003
Location: uk
Posts: 234
Re: NeroAPI / Burning isolated files in a directory specific to each session

Programming language?
Technology.. Nerocom, nerocmd, nerosdk?
There are lots of examples throughout this forum maybe you can have a look and see if you can get started from these?
unison is offline   Reply With Quote
Old 11-05-2005   #3 (permalink)
New on Forum
 
Join Date: Apr 2005
Posts: 11
Re: NeroAPI / Burning isolated files in a directory specific to each session

Hi,

Of course I have already look through the forum...
but I didnt find the answer to my problem
My programming language is C++ (Visual 6), and I use NeroAPI

I think I need to modify my NERO_ISO_TRACK to describe the tree.. Is anyone have a short exemple ?

Thanks in advance
fpa2 is offline   Reply With Quote
Old 11-05-2005   #4 (permalink)
Moderator
 
Join Date: Jan 2005
Posts: 158
Re: NeroAPI / Burning isolated files in a directory specific to each session

You mean to modify your NERO_ISO_ITEM. Yes that's true.
You can set the name of the burnt directory using 'longFileName' or 'unicodeFileName'. Then attach your files to this NERO_ISO_ITEM directory as sundirectory items. Burn the track using NBF_CLOSE_SESSION flag, so you will be able to burn additional sessions on the same disc.
If you want all previous sessions are visible in the last one, you will have each time you burn new session to import the last session from the disc and to merge it with the new one you intend to burn now.
__________________
czykit
Nero AG
czykit is offline   Reply With Quote
Old 31-05-2005   #5 (permalink)
New on Forum
 
Join Date: May 2005
Posts: 1
Re: NeroAPI / Burning isolated files in a directory specific to each session

czykit ,could you teld me how to " import the last session from the disc and to merge it with the new one "?could you please give me and example or tel me use which function? thank you very much
jines is offline   Reply With Quote
Old 05-06-2005   #6 (permalink)
New on Forum
 
Join Date: May 2005
Posts: 3
Re: NeroAPI / Burning isolated files in a directory specific to each session

I too had a specific multi session archive job I wanted doing. I put together a simple test program using Visual Basic (NeroCom.dll objects).

I then went to do the 'real thing' using Visual C++ 6.0, and found that the SDK api supported by Neroapi.dll was very different. I have succesfully created classes from com objects before using the Class Wizard, so I thought I would do the same with NeroCom.dll. It worked a treat, except there were no events. I then manually extended the autogenerated classes and added the events I needed. I also changed some of the functions so that they pass Class instances and not dispatch pointers.

It all worked a treat, and I now have my multi session archive system in place. The new classes are not complete or fully tested, but I have put them, and a test program at

http://www.thedyers.org.uk/Nero.zip

if anyone wants to test them out, or complete the job. Nerocom is a static library with the classes that wrap the Nercom.dll COM objects. I use it with Nero 6.0. I have not tried it with other releases.

NeroTest is a simple GUI application that adds files one at a time to a disk. My full application adds and deletes files and directories to automatically syncronise selected areas of my disk with the contents of a CDR.
NigelD is offline   Reply With Quote
Old 14-06-2005   #7 (permalink)
New on Forum
 
Join Date: Apr 2005
Posts: 11
Re: NeroAPI / Burning isolated files in a directory specific to each session

Hi,

I've tried to modify my code to burn in a first time my selected files directly in a directory on the CD. Next step will be to burn with multisession...

Here is my code :
[code]
int BurnFiles::BurnCD()
{
char* vMsg = new char[MSG_LENGTH];
if(m_APIInitialized){
// Is there something to burn ??
if(m_NumFiles > 0){
int res;

// Number Max of files = 99
if (m_NumFiles >= 99){
sprintf(vMsg,"[PRJ] Error Number of files to burn so important (%i) more than 99!",m_NumFiles);
SetBurnStatus(vMsg);
}


// Create the tree of NERO_ISO_ITEMS
// 1- Create the root directory
NERO_ISO_ITEM* v_RootItem = new NERO_ISO_ITEM();
v_RootItem->longFileName = "TestMulti";
v_RootItem->isDirectory = true;
v_RootItem->nextItem = &m_ItemsToBurn[0];

// 2- Chain the others items.
for (int i = 0; i < m_NumFiles; i++){
m_ItemsToBurn[i].nextItem = &m_ItemsToBurn[i+1];
}
// Close the chain
m_ItemsToBurn[i+1].nextItem = NULL;


// 3- Create the IsoTrack Item.
m_IsoTrack = NeroCreateIsoTrackEx(v_RootItem,m_CDName,NCITEF_USE_JOLIET|NCITEF_CREATE_ISO_FS|NCITEF_CRE ATE_UDF_FS);
if (0 == m_IsoTrack)
{
SetBurnStatus("[PRJ]NeroCreateIsoTrackEx is failed.\n");
}
else
{

// 4- Create the Write CD Structure.
int size = sizeof (NERO_WRITE_CD) + (m_NumFiles - 1) * sizeof (NERO_AUDIO_TRACK);
m_WriteCD = (NERO_WRITE_CD *)malloc (size);

if(!m_WriteCD){
SetBurnStatus("[PRJ] Memory Problem.. Can t allocate WriteFile Objetc!");
return WRITECD_MEMORY_PB;
}

memset (m_WriteCD, 0, sizeof (m_WriteCD));
//memset(m_WriteCD , 0 ,size);

m_WriteCD->nwcdMediaType = MEDIA_CD;
m_WriteCD->nwcdNumTracks = 0;m_NumFiles;
m_WriteCD->nwcdArtist = m_Artist;
m_WriteCD->nwcdTitle = m_Title;

// m_IsoTrack contains general information.
m_WriteCD->nwcdIsoTrack = m_IsoTrack;

res = NeroBurn (m_NeroDeviceHandle,NERO_ISO_AUDIO_CD ,m_WriteCD,
NBF_WRITE // Write and simulate are not mutually exclusive, we just use either one or the other here.
| NBF_CLOSE_SESSION
| NBF_DISABLE_ABORT
| NBF_DETECT_NON_EMPTY_CDRW
| NBF_SPEED_IN_KBS
| (m_bup ? NBF_BUF_UNDERRUN_PROT : 0)
| (m_verify ? NBF_VERIFY : 0)
| (m_no_eject ? NBF_DISABLE_EJECT : 0),
m_BurnSpeed*m_SelectedDeviceInfo->nsdiWriteSpeeds.nsiBaseSpeedKBs,
m_NeroProgress);
switch(res)
{
// 0
case NEROAPI_BURN_OK:
break;
case NEROAPI_BURN_UNKNOWN_CD_FORMAT:
SetBurnStatus("[PRJ] BurnCD() : unknown CD format");
break;
case NEROAPI_BURN_INVALID_DRIVE:
SetBurnStatus("[PRJ] BurnCD() : invalid drive");
break;
case NEROAPI_BURN_FAILED:
SetBurnStatus("[PRJ] BurnCD() : burn failed");
break;
case NEROAPI_BURN_FUNCTION_NOT_ALLOWED:
SetBurnStatus("[PRJ] BurnCD() : function not allowed");
break;
case NEROAPI_BURN_DRIVE_NOT_ALLOWED:
SetBurnStatus("[PRJ] BurnCD() : drive not allowed");
break;
case NEROAPI_BURN_USER_ABORT:
SetBurnStatus("[PRJ] BurnCD() : aborted by the user");
break;
default:
SetBurnStatus("[PRJ] BurnCD() : unknown error");
}
return res;
NeroFreeIsoTrack (m_IsoTrack);

}
}else{
sprintf(vMsg,"[PRJ] No File in the burn list. Nothing to burn!");
SetBurnStatus(vMsg);
return NO_FILE_TO_BURN_ERROR;
}

}else{
sprintf(vMsg,"[PRJ] API not yet initialized. Impossible to burn!");
SetBurnStatus(vMsg);
return API_NOT_INITIALIZED;
}
}
[code]

I get an unHandled exception in NEROAPI.DLL...
I suppose the problem is about the IsoTrack object m_IsoTrack, but I don't undestand where is my problem...

Please, share your expertise with me

reminder : Language C++ (Vc6.0), NeroAPI 6.6.0.1
fpa2 is offline   Reply With Quote
Old 15-06-2005   #8 (permalink)
CD Freaks Member
 
Join Date: Mar 2005
Posts: 109
Re: NeroAPI / Burning isolated files in a directory specific to each session

Just a few things that I realized reading your code:

You should use NeroCreateIsoItem instead of new NERO_ISO_ITEM.

Is the expression in the loop (2) correct: "m_ItemsToBurn[i+1]"? Do you really have m_NumFiles+1 items to burn in the collection?

Instead of (4) you can use "NERO_WRITE_CD WriteCD;" or something similar.

What's this: "m_WriteCD->nwcdNumTracks = 0;m_NumFiles;" (ok, its legal C++, but the "m_NumFiles" may be omitted.)

Note that you have to free aquired resources, either with "delete", "delete[]", "free" or any "NeroFree*" function, whichever is appropriate in the special case.
Oliver M. is offline   Reply With Quote
Old 15-06-2005   #9 (permalink)
New on Forum
 
Join Date: Apr 2005
Posts: 11
Re: NeroAPI / Burning isolated files in a directory specific to each session

hi,

thanks for your reply.
I've done some corrections following your usefull instructions.
But i still have my problem... my app crashes when I call NeroBurn function..
Access Violation (0xc0000005) NEROAPI.dll

here is my code....

[i]int VsnPIBurnResults::VsnBurnCD()
{
char* vMsg = new char[MSG_LENGTH];
if(m_APIInitialized){
// Is there something to burn ??
if(m_NumFiles > 0){
int res = -1;
int i = 0;
// Number Max of files = 99
if (m_NumFiles >= 99){
sprintf(vMsg,"[PRJ] Error Number of files to burn so important (%i) more than 99!",m_NumFiles);
SetBurnStatus(vMsg);
}
// Create the tree of NERO_ISO_ITEMS
// 1- Create the root directory
NERO_ISO_ITEM* v_RootItem = NeroCreateIsoItem();
v_RootItem->longFileName = "TestMulti";
v_RootItem->isDirectory = true;
v_RootItem->nextItem = m_ItemsToBurn[0];

// 2- Chain the others items.
for (i = 0; i < m_NumFiles-1; i++){
m_ItemsToBurn[i]->nextItem = m_ItemsToBurn[i+1];
}
// Close the chain
m_ItemsToBurn->nextItem = NULL;

// 3- Create the IsoTrack Item.
m_IsoTrack = NeroCreateIsoTrackEx(v_RootItem,m_CDName,NCITEF_USE_JOLIET|NCITEF_CREATE_ISO_FS|NCITEF_CRE ATE_UDF_FS);
if (0 == m_IsoTrack)
{
SetBurnStatus("[PRJ]NeroCreateIsoTrackEx is failed.\n");
}
else
{

// 4- Create the Write CD Structure.
NERO_WRITE_CD WriteCD;
int size = sizeof (NERO_WRITE_CD) + (m_NumFiles - 1) * sizeof (NERO_AUDIO_TRACK);
WriteCD.nwcdMediaType = MEDIA_CD;
WriteCD.nwcdNumTracks = m_Num_Files;
WriteCD.nwcdArtist= m_Artist;
WriteCD.nwcdTitle = m_Title;

// m_IsoTrack contains general information.
WriteCD.nwcdIsoTrack = m_IsoTrack;

res = NeroBurn (m_NeroDeviceHandle,NERO_ISO_AUDIO_CD ,&WriteCD,
NBF_WRITE
| NBF_CLOSE_SESSION
| NBF_DISABLE_ABORT
| NBF_DETECT_NON_EMPTY_CDRW
| NBF_SPEED_IN_KBS
| (m_bup ? NBF_BUF_UNDERRUN_PROT : 0)
| (m_verify ? NBF_VERIFY : 0)
| (m_no_eject ? NBF_DISABLE_EJECT : 0),
m_BurnSpeed*m_SelectedDeviceInfo->nsdiWriteSpeeds.nsiBaseSpeedKBs,m_NeroProgress);
switch(res)
{
case NEROAPI_BURN_OK:
break;
case NEROAPI_BURN_UNKNOWN_CD_FORMAT:
SetBurnStatus("[PRJ] BurnCD() : unknown CD format");
break;
case NEROAPI_BURN_INVALID_DRIVE:
SetBurnStatus("[PRJ] BurnCD() : invalid drive");
break;
case NEROAPI_BURN_FAILED:
SetBurnStatus("[PRJ] BurnCD() : burn failed");
break;
case NEROAPI_BURN_FUNCTION_NOT_ALLOWED:
SetBurnStatus("[PRJ] BurnCD() : function not allowed");
break;
case NEROAPI_BURN_DRIVE_NOT_ALLOWED:
SetBurnStatus("[PRJ] BurnCD() : drive not allowed");
break;
case NEROAPI_BURN_USER_ABORT:
SetBurnStatus("[PRJ] BurnCD() : aborted by the user");
break;
default:
SetBurnStatus("[PRJ] BurnCD() : unknown error");
}
// del the tree of nero_items
NeroFreeIsoItemTree(v_RootItem);
// del the nero iso track
NeroFreeIsoTrack (m_IsoTrack);
delete vMsg;
return res;
}
}else{
sprintf(vMsg,"[PRJ] No File in the burn list. Nothing to burn!");
SetBurnStatus(vMsg);
return NO_FILE_TO_BURN_ERROR;
}
}else{
sprintf(vMsg,"[PRJ] API not yet initialized. Impossible to burn!");
SetBurnStatus(vMsg);
return API_NOT_INITIALIZED;
}
}



my array m_ItemsToBurn is definied in the following fuction :


bool Burn::AddFileToBurnList(char* aFileToAdd, char* aBurntFileName)
{
// onnly files will be added here.. no verif at the moment!.. to do for extensions
char* vMsg = new char[MSG_LENGTH];
if(m_APIInitialized){
m_ItemsToBurn[m_NumFiles] = NeroCreateIsoItem();
if(m_ItemsToBurn[m_NumFiles] == NULL){
sprintf(vMsg,"Impossible to add the file %s...!!!",aFileToAdd);
SetBurnStatus(vMsg);
return false;
}
sprintf(m_ItemsToBurn[m_NumFiles]->sourceFilePath, "%s", aFileToAdd);
strcpy(m_ItemsToBurn[m_NumFiles]->fileName, aBurntFileName);
m_ItemsToBurn[m_NumFiles]->isDirectory = FALSE;
m_ItemsToBurn[m_NumFiles]->isReference = FALSE;

m_NumFiles++;
sprintf(vMsg,"Add file %s to burn list (file number %d)",aFileToAdd, m_NumFiles);
SetBurnStatus(vMsg);
return true;
}else{
sprintf(vMsg,"API not yet initialized!");
SetBurnStatus(vMsg);
return false;
}
}


do you see more errors in my code ?
What do i wrong ?

thanks for your help
Fpa2
fpa2 is offline   Reply With Quote
Old 15-06-2005   #10 (permalink)
CD Freaks Member
 
Join Date: Mar 2005
Posts: 109
Re: NeroAPI / Burning isolated files in a directory specific to each session

(2) Did you create each item in the m_ItemsToBurn with the appropriate NeroCreateIsoItem function?

(4) The "int size = sizeof..." calculation is obsolete.

(4) Initialize the structure memory by "memset(&WriteCD, 0, sizeof(WriteCD));". Maybe this caused the access violation.

(4) "WriteCD.nwcdNumTracks = m_Num_Files;" must be set to 0, since this member is for audio-tracks.

(4) Remove Artist and Title, since you do not want to burn an Audio-CD anyway (set to NULL).

Just for testing, at NeroBurn set the burn speed to 0 (max) and the progress to NULL.
Oliver M. is offline   Reply With Quote
Old 15-06-2005   #11 (permalink)
New on Forum
 
Join Date: Apr 2005
Posts: 11
Re: NeroAPI / Burning isolated files in a directory specific to each session

Thanks for your answer Oliver
(2) . Yes, all items USED in the array are correctly initialized with the function NeroCreateIsoItem (the function is AddFileToBurnList and is given at the end of the code) (from 0 to m_NumFiles)

(4) I modified my code like this


// 4- Create the Write CD Structure.
NERO_WRITE_CD WriteCD;
WriteCD.nwcdMediaType = MEDIA_CD;
WriteCD.nwcdNumTracks = 0;
WriteCD.nwcdArtist= NULL;
WriteCD.nwcdTitle = NULL;
// m_IsoTrack contains general information.
WriteCD.nwcdIsoTrack = m_IsoTrack;

res = NeroBurn (m_NeroDeviceHandle,NERO_ISO_AUDIO_CD , &WriteCD,
NBF_WRITE
| NBF_CLOSE_SESSION
| NBF_DISABLE_ABORT
| NBF_DETECT_NON_EMPTY_CDRW
| NBF_SPEED_IN_KBS
| (m_bup ? NBF_BUF_UNDERRUN_PROT : 0)
| (m_verify ? NBF_VERIFY : 0)
| (m_no_eject ? NBF_DISABLE_EJECT : 0),
0, NULL);


the result is the same, i still have Acces violation 0xCOOOOO5 when I call NeroBurn function.

In debug mode, I've verified the different objects that seems to be correct (Write CD, v_RootItem...etc)

What is wrong again ?


Fpa2
fpa2 is offline   Reply With Quote
Old 15-06-2005   #12 (permalink)
CD Freaks Member
 
Join Date: Mar 2005
Posts: 109
Re: NeroAPI / Burning isolated files in a directory specific to each session

As mentioned above, try to zeroize the NERO_WRITE_CD structure before you use it:
Code:
NERO_WRITE_CD WriteCD;
memset(&WriteCD, 0, sizeof(WriteCD));
WriteCD.nwcdMediaType = MEDIA_CD;
WriteCD.nwcdNumTracks = 0;
WriteCD.nwcdArtist= NULL;
WriteCD.nwcdTitle = NULL;
WriteCD.nwcdIsoTrack = m_IsoTrack;
Does it still crash?

Ah, and please use correct code tags like this: [ code] and [ /code] (without blanks).
Oliver M. is offline   Reply With Quote
Old 15-06-2005   #13 (permalink)
New on Forum
 
Join Date: Apr 2005
Posts: 11
Re: NeroAPI / Burning isolated files in a directory specific to each session

Oliver,

Thank you very much for your time and your help!
It seems to works fine now. I have added the previous sessions too, and it's ok.

Thanks again.
best regards

fpa2
fpa2 is offline   Reply With Quote
Old 16-06-2005   #14 (permalink)
CD Freaks Member
 
Join Date: Mar 2005
Posts: 109
Re: NeroAPI / Burning isolated files in a directory specific to each session

You're welcome.
Oliver M. is offline   Reply With Quote
 
Reply


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

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
Cannot burn specific files nmpaulcp Nero & InCD 9 28-12-2004 15:21
Open last session on CD-RW with NeroApi bhk Nero SDK Discussion Forum 1 30-04-2004 13:08
Sub-Directory Files Not Burning joshuagary Newbie Forum 0 09-04-2004 21:54
Same directory name as those from previous session willgoh Nero SDK Discussion Forum 4 31-03-2004 12:48
Wrong directory order in UDF part of ISO/UDF filesystem (NeroAPI) CouJo Nero SDK Discussion Forum 3 26-11-2003 08:51


All times are GMT +2. The time now is 23:44.


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