Originally posted by Damion
I try to burn a data cd since yesterday but I cant find whats worng. Can you halp me please. Everytime I call the NeroBurn command I got the Errorcode for NERAPI_BURN_FAILED.
I have a similar problem (s. thread Initialization failure) and can give you a few hints to your code. Whether these will help you solving the NEROAP_BURN_FAILED, I don't know. Let us know, please.
It would also be of help, if you could tell the SDK and Nero version, you're using.
Originally posted by Damion
pvIsoItem=NeroBuildIsoTreeFromPath( "C:\ est");
pvIsoTrack = NeroCreateIsoTrackEx(pvIsoItem,"Test",NCITEF_USE_JOLIET);
ptNeroWriteCD = (NERO_WRITE_CD *)malloc(sizeof(NERO_WRITE_CD));
memset(ptNeroWriteCD, 0x0, sizeof(NERO_WRITE_CD));
ptNeroWriteCD->nwcdMediaType=MEDIA_CD; /* Media on which the data should be written */
tBurnError = NeroBurn(NeroDeviceHandle,
NBF_SIMULATE | NBF_CLOSE_SESSION | NBF_DISABLE_EJECT,
Try to do some output of the generated ISOItemTree. Here's a function that might be of help
void CVideoArchivierung::DebugPrintIsoTree (const NERO_ISO_ITEM * pItem, int iLevel)
string indent(iLevel*2, ' ');
// Indent each level a little bit.
cout << indent << "fileName : [" << pItem->fileName << "]" << endl;
cout << indent << "longFileName : [" << ((NULL == pItem->longFileName) ? "" : pItem->longFileName) << "]" << endl;
cout << indent << "isDirectory : " << (pItem->isDirectory ? "true" : "false" ) << endl;
cout << indent << "isReference : " << (pItem->isReference ? "true" : "false" ) << endl;
cout << indent << "sourceFilePath : [" << pItem->sourceFilePath << "]" << endl;
cout << indent << "longSourceFilePath: [" << ((NULL == pItem->longSourceFilePath) ? "" : pItem->longSourceFilePath) << "]" << endl;
cout << indent << "nextItem : " << (long)pItem->nextItem << endl;
cout << indent << "userData : " << (long)pItem->userData << endl;
cout << indent << "dataStartSec : " << pItem->dataStartSec << endl;
cout << indent << "dataLength : " << (long)pItem->dataLength << endl;
cout << indent << "itemSize : " << pItem->itemSize << endl;
cout << indent << "importInfo : " << (long)pItem->importinfo << endl;
// If it is a directory, show next level
DebugPrintIsoTree (pItem->subDirFirstItem, iLevel + 1);
pItem = pItem->nextItem;
You set the nwcdNumTracks member of the ptNeroWriteCD structure to 1. I've learned that this member refers to audio tracks only. So, as long as you do not have any audio tracks, set it to 0 (or leave it untouched, as you filled the whole struct's memory area with 0).
Because there aren't any tracks, the size of the ptNeroWriteCD struct you allocate is too big. Try using this formula:
iSize = sizeof(NERO_WRITE_CD) + (iNumTracks-1)*sizeof(NERO_AUDIO_TRACK);
The member nwcdMediaType of the ptNeroWriteCD struct is a very crucial one. Using MEDIA_CD seems to work in most cases. I have tried to use something like (DWORD)(MEDIA_CDRW|MEDIA_DVD_ANY) because my software should write to either of a CDRW or DVD burner, but that hadn't worked. You have to use the appropriate DWORD value matching the media exactly.
Try getting some more output after the NEROAPI_BURN_FAILED:
char * NeroResult = NeroGetErrorLog();
cout << "Nero error: <" << endl << NeroResult << endl << ">" << endl;
Hope that helped a bit.