Erease CDRW/DVDRW

I delete a RW medium and would like to burn it. How I know when this delete is finished?

Public Sub BurnBackupOnCD(strBackupName As String, intDrive As Integer, strMediaTyp As String)

Set Folder = New NeroFolder

Dim drives As INeroDrives

'AvailableDevices.Text = strDrive

Set drives = nero.GetDrives(GetNeroMediaTyp(strMediaTyp))

AvailableDevices.ListIndex = intDrive

Set Drive = drives(AvailableDevices.ListIndex)
Dim isotrack As NeroISOTrack

Set isotrack = New NeroISOTrack

Dim a

If Drive.DeviceReady = False Then

    Drive.LoadCD

    isotrack.BurnOptions = NEROLib.NERO_BURN_OPTION_USE_JOLIET + NEROLib.NERO_BURN_FLAG_DISABLE_EJECT Or NEROLib.NERO_BURN_OPTION_CREATE_ISO_FS + NEROLib.NERO_BURN_FLAG_DISABLE_EJECT
     
    a = Drive.CDRWErasingTime(True)
    
    Drive.EraseCDRW True

Else

    isotrack.BurnOptions = NEROLib.NERO_BURN_OPTION_USE_JOLIET + NEROLib.NERO_BURN_FLAG_DISABLE_EJECT Or NEROLib.NERO_BURN_OPTION_CREATE_ISO_FS + NEROLib.NERO_BURN_FLAG_DISABLE_EJECT
     
    a = Drive.CDRWErasingTime(True)
    
    Drive.EraseCDRW True

End If

GoTo quit

handle_error:

Call WriteLog(Now + " Error" + Err.Description + nero.LastError)

quit:

End Sub

Public Function GetNeroMediaTyp(strMediaTyp As String)

Select Case strMediaTyp
Case “CDR”
GetNeroMediaTyp = &H101
Case “CDRW”
GetNeroMediaTyp = &H81
Case “DVD-R”
GetNeroMediaTyp = &H804
Case “DVD-RW”
GetNeroMediaTyp = &H1004
Case “DVD+R”
GetNeroMediaTyp = &H2008
Case “DVD+RW”
GetNeroMediaTyp = &H4008
Case “DVD RAM”
GetNeroMediaTyp = &H10

End Select

End Function

best regards
MatserOfDisaster

You should handle OnDoneErase event.

I have any questions

How I can call CDInfo method in VB?

???

Private Sub Drive_OnDoneCDInfo(ByVal pCDInfo As NEROLib.INeroCDInfo)

debug.print pCDInfo.IsWriteable & pCDInfo.pCDInfo

End Sub

http://club.cdfreaks.com/showthread.php?threadid=78610

I am not sure what you mean? Just call CDInfo method on a drive object with a combination of NERO_CDINFO_FLAGS or zero. Once the operation is complete, OnDoneCDInfo event will be fired. Then you can access the disc information.