DVD burning with neroSDK

Hello all,

I got a problem using Nero SDK. I’m french so sorry for my english.

I need Nero SDK to save datas on a DVD, using Visual Basic. I’m doing this for a person how had a CD-RW drive and the fonction used to work fine. This person has buy a DVD±RW drive to be able to save datas on a single disc (instead of 3 CDs).
It is now impossible to burn a DVD. When i launch the burn process, using :

NeroDrive.BurnIsoAudioCD "", "", False, ISOtrack, Nothing, Nothing, NERO_BURN_FLAG_BUF_UNDERRUN_PROT, 0, NERO_MEDIA_DVD_P_RW

the drive eject the DVD and the


is called with



I was looking for such a problem in others thread but i didn’t find.

Does somebody now the reason of this error ?
I can give the complete code if necessary.

Thanks a lot


The first thing I would check is the media type you are using. There are a couple of places in the sample program where this is defined. I can remeber two. The first is when you discover the drive and the other is when you call BurnISOAudioTrack. In section 8.1.23 of the documentation for NeroCom they list all the media types. You probably have NERO_MEDIA_CDR now and need to change it to something like NERO_MEDIA_DVD_M or NERO_MEDIA_DVD_P.

Also you can declare multiple media types. For example, if you want to burn to both CD-R/RW’s and DVD-R/RW’s you would put in:


Hope this helps.

Thanks for your answer…

The first thing I would check is the media type you are using.

This is the first thing i checked…but it didn’t work :frowning:
I use NERO_MEDIA_DVD_P_RW, but impossible to burn…

Another idea ?

Try adding NERO_BURN_FLAG_WRITE to burn flags. You are now neither writing nor simulating.

The NERO_BURN_FLAG_WRITE was already defined in my code. :sad:

I have rewrite my all code so i can check everything. I used to work once, but never again since (and i didn’t change anything). My goal is to burn a single file on a DVD. But if the media is not empty, my software has to erase it (using EraseDisc function).
I began with writting the burning fonctions, erasing the DVD+RW manually with Nero Burning Rom 6. It works very well. Then i tried to add functions to erase the DVD. The first time i launched my newly created functions, the DVD was erased, then the file burned (at least i guess, because the previous file on the DVD and the new one were exactly the same -size & name-, but the OnDoneBurn function gave me a NERO_BURN_OK StatusCode). I launched it a second time : just after EraseDisc function was launched, OnDoneBurn function gave me a USER_ABORT StatusCode.

I don’t know if my explanations are clear, so here are the main parts of my code.

Sub burnData()
'…cree un objet Nero
Set Nero = New Nero

    Dim Lecteurs As NeroDrives
    '...recupere la liste des graveurs de DVD+RW de l'ordi
    Set Lecteurs = Nero.GetDrives(NERO_MEDIA_DVD_P_RW)

    Dim i As Integer
    '...selectionne le graveur qui supporte les RW
    For i = 0 To Lecteurs.Count - 1
        If Lecteurs(i).DevType = NERO_SCSI_DEVTYPE_WORM Then Exit For
    Set Graveur = Lecteurs(i)
    '...initialise le repertoire des donnees du cd
    Dim cdFolder As NeroFolder
    Set cdFolder = New NeroFolder
    '....initialise la piste ISO
    Dim pisteISO As NeroISOTrack
    Set pisteISO = New NeroISOTrack
    pisteISO.RootFolder = cdFolder

    '...le met dans le nero iso track
    Dim fichierNero As NeroFile
    Set fichierNero = New NeroFile
    cdFolder.Files.add fichierNero
    fichierNero.name = tmpSaveFile
    fichierNero.SourceFilePath = "D:\" & fichierNero.name
    '...initialise le nom de la piste iso
    pisteISO.name = Format(Now, "yyyy-mm-dd")

'...initialise la gravure
'...options de gravure de la piste ISO : system de fichier iso + joliet

'...lancement de la gravure
Graveur.BurnIsoAudioCD "", "", False, pisteISO, Nothing, Nothing, _
                       NERO_BURN_FLAG_BUF_UNDERRUN_PROT + _
                       NERO_BURN_FLAG_DETECT_NON_EMPTY_CDRW + _
                       NERO_BURN_FLAG_WRITE, 0, NERO_MEDIA_DVD_P_RW

Exit Sub

Sub eraseDisc()
Graveur.eraseDisc True, NERO_ERASE_MODE_DEFAULT
End Sub

Private Sub Graveur_OnDoneErase(ok As Boolean)
If ok Then
End If
End Sub

Private Sub Graveur_OnDoneBurn(StatusCode As NEROLib.NERO_BURN_ERROR)
Select Case StatusCode <-- It give me StatusCode=3
Case NERO_BURN_OK 'Successfull !
Case Else
End Select
End Sub

Private Sub nero_OnNonEmptyCDRW(Response As NEROLib.NERO_RESPONSE)
End Sub

I hope you will be able to help me…
Many thanks by advance and, again, sorry for my poor english :bow:


I am by no means an expert so am prepared to be corrected but the USER_ABORT reply suggests to me that Nero.Abort is been called somewhere, which is then aborting the erase/burn process.

The only time I can see this in the code you have posted is in the OnNonEmptyCDRW event, unless you have another instance in your code that you have not posted then I guess that the OnNonEmptyCDRW event is occurring which I guess is correct if you have loaded a non-empty DVD. You then do an abort and try to erase, for some reason the the abort is still active when the erase is started. Maybe you should try to wait for a short period - put in a 10second delay and see what happens or maybe you must clear the abort in some way?


the USER_ABORT reply suggests to me that Nero.Abort is been called

I tried to remove the Nero.Abort you suggested and all others Nero.Abort of my code. So the problem is now a bit different :
Their are 2 possible cases (using the code i gave above, without Nero.Abort) :
_______- The DVD is empty when i launch the burning process, in this case, the OnNonEmptyCDRW events is not called and burning process works very well.
_______- The DVD is not empty when launching the burning process, in this case, the OnNonEmptyCDRW events is called and works very well. But after, in the burnData sub, and more precisely when launching the Graveur.BurnIsoAudioCD function … my Visual Basic 6 get CRASHED !

I don’t understand the problem…

plz plz plz i need help !!!

i can burn now, but “sometimes” it crashes VB. I think i don’t abort nero at the end of the burning process, and if i try to burn again, it crashes. When the burn process is ended, i can see the imapi.exe process still running on windows. How could i turn it off at the end of the burn fonction ?

Thx a lot.