Burning DVD using NeroCOM

Okay, so I found the bug in the NeroCOM sample which kept it from burning CDs on my system. Now I’m trying to figure out how to use NeroCOM to burn DVDs (just data).

  1. The NeroCOM sample doesn’t support burning DVDs. Is that because NeroCOM doesn’t support burning DVDs, or is it just the way the sample was written?

  2. When I try to burn a DVD using NeroCOM, it “hangs” after trying to burn the short lead out (I think that’s the status message).

Any suggestions on how to use NeroCOM to burn DVDs would be appreciated!

  • Mark
  1. The NeroCOM sample doesn’t support burning DVDs. Is that because NeroCOM doesn’t support burning DVDs, or is it just the way the sample was written?
    NeroCOM does support writing DVDs. The sample was written in a way that it expects only a CD medium. Please note that BurnIsoAudioCD uses NERO_MEDIA_CD as the last parameter. This in turn gives the following error when trying to write on DVD media: “Waiting for a particular media type: CD-R/RW”. Changing the media to NERO_MEDIA_DVD_ANY writes the DVD just fine.

When I try to burn a DVD using NeroCOM, it “hangs” after trying to burn the short lead out (I think that’s the status message).
Is this modified or unmodified sample application? If modified, what are the modifications?

Alex,

Thank you, yes, I saw that flag you refer to in the NeroFiddlesCom source code. I just wasn’t sure if the COM object only supported CDs, or the author of NeroFiddlesCom just wrote it that way.

As to your second question, the answer is more complex. I’m writing my stuff in C#, under the .NET Framework 1.1. So quite a few things are different in detail, although similar in approach to the NeroFiddlesCom approach (in fact, I based my test application off of “rewriting” NeroFiddlesCom into C#).

Here’s the relevant code from the Burn button click handler:

// folder is just a NeroFolder class variable
folder = new NeroFolder();

// drive is a NeroDrive class variable
drive = (NeroDrive) drives[cbxDrive.SelectedIndex];

// disable user choices during burn
btnAbort.Enabled = true;
btnBrowse.Enabled = false;
btnBurn.Enabled = false;
chkSimulate.Enabled = false;
cbxMedia.Enabled = false;
cbxDrive.Enabled = false;
cbxSpeed.Enabled = false;

// event handlers for NeroDrive events
drive.OnAborted += new _INeroDriveEvents_OnAbortedEventHandler(drive_OnAborted);

drive.OnAddLogLine += new _INeroDriveEvents_OnAddLogLineEventHandler(drive_OnAddLogLine);

drive.OnDoneBurn += new _INeroDriveEvents_OnDoneBurnEventHandler(drive_OnDoneBurn);

drive.OnDoneWaitForMedia += new _INeroDriveEvents_OnDoneWaitForMediaEventHandler(drive_OnDoneWaitForMedia);

drive.OnProgress += new _INeroDriveEvents_OnProgressEventHandler(drive_OnProgress);

drive.OnSetPhase += new _INeroDriveEvents_OnSetPhaseEventHandler(drive_OnSetPhase);

NeroISOTrack isotrack = new NeroISOTrack();
isotrack.Name = “TestTrack”;
isotrack.RootFolder = folder;

// assign the test file we’re going to burn
NeroFile file = new NeroFileClass();
folder.Files.Add(file);
file.Name = Path.GetFileName(tbxFile.Text);
file.SourceFilePath = tbxFile.Text;

isotrack.BurnOptions = NERO_BURN_OPTIONS.NERO_BURN_OPTION_CREATE_ISO_FS | NERO_BURN_OPTIONS.NERO_BURN_OPTION_USE_JOLIET;

NERO_MEDIA_TYPE mediaType = NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY;

// I’ve found you can’t specify both simulate and burn
NERO_BURN_FLAGS burnFlag = chkSimulate.Checked ? NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE : NERO_BURN_FLAGS.NERO_BURN_FLAG_SIMULATE;

drive.BurnIsoAudioCD(“Pop Star”, “Title”, true, isotrack, null, null, burnFlag, 0, mediaType);

Here are the messages that get reported (as per what NeroFiddlesCom does):

Reading directories
Creating directories
Checking discs
Writing to cache
Caching of files started
Caching of files completed
Writing to disc
Burn process started at 8x (11,080 KB/s)
Writing Lead-in
Writing tracks
Writing Lead-in

At this point the progress bar (also written to behave like NeroFiddlesCom) reaches 100%… and the burn just hangs.

I don’t know if it ever finishes, but I’ve waited 10 minutes without the burn closing itself out.

What’s interesting is that the burn actually took place, as I can see after I open the disc under Windows Explorer. Unfortunately, I have to reboot the computer to do this, because something in the burning process prevents me from opening the drive under Explorer unless I reboot. I guess the Nero API is still in its “do not interrupt” phase.

I can create a DVD using the NeroAPITest program, or with Nero itself. So it’s something in the way the COM object is written that’s causing the problem.

Any thoughts or suggestions?

  • Mark