Overburning in VB.net with NeroCOM

vbimport

#1

Hello,

I try to overburn a CD with VB.net. Thanks to the post Overburning CD witn VB6 and NERO COM I declared a new Nero object like that:

    Dim LoopDrive As NeroDrive
    Dim oISOFile As New System.IO.FileInfo(ISOList(0))
    Dim NeroFirst As New Nero

    If File.Exists(ISOList(0)) Then
        If oISOFile.Length > CDSize And oISOFile.Length <= CDOverSize Then
            NeroFirst.EnableOverburn = True
            NeroFirst.OverburnSize = 439000
        End If
    End If

    Drives = NeroFirst.GetDrives(NERO_MEDIA_TYPE.NERO_MEDIA_CDR + NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY)
    For Each LoopDrive In Drives
        If LoopDrive.DeviceName = CBGraveur.SelectedItem Then
            Drive = LoopDrive
            If oISOFile.Length <= CDOverSize Then
                Drive.BurnImage2(ISOList(0), NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE + NERO_BURN_FLAGS.NERO_BURN_FLAG_DAO + NERO_BURN_FLAGS.NERO_BURN_FLAG_BUF_UNDERRUN_PROT + NERO_BURN_FLAGS.NERO_BURN_FLAG_DETECT_NON_EMPTY_CDRW, 0, NERO_MEDIA_TYPE.NERO_MEDIA_CD)
            Else
                Drive.BurnImage2(ISOList(0), NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE + NERO_BURN_FLAGS.NERO_BURN_FLAG_DAO + NERO_BURN_FLAGS.NERO_BURN_FLAG_BUF_UNDERRUN_PROT + NERO_BURN_FLAGS.NERO_BURN_FLAG_BOOKTYPE_DVDROM, 0, NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY)
            End If
        End If
    Next

But this fail with this message: “Nero has already been initialized! You can’t change this data once Nero is initialised!”
Of course, if I just create Nero variable as an object, it cannot set EnableOverburn nor OverburnSize property.
Where am I wrong ?

Thanks for your help.

Stephane


#2

Does somebody have a piece of code in vb.net to overburn a disc ?

Thanks

Stephane


#3

up


#4

Hi. I have just had the same issue. I think the answer to your question is the following: There is seemlingly only a single Nero object. When you do a “x = new Nero()” type of operation you get a reference to that single object. The first time you do this is when you can set the overburning properties on that object. After that you will not be able to change it anymore. Therefore you probably only need to create one Nero object up-front at application startup, set the overburning properties, and then use that same instance everywhere.