BurnIsoAudioCD Problem


I’m writing an application to write a couple of audio tracks to a disk, however every time I call drive.BurnIsoAudioCD it fails with a user abort error, even when passed NERO_BURN_FLAG_DISABLE_ABORT.

I’ve gone over my code with a fine tooth comb, and I can’t seem to spot the problem - I wonder if anyone can help me work out where the problem lies.

I’m running WinXP SP2, using Nero and Visual Studio .NET 7.1

The only other thing that I can think of that may be causing the problem is that I’ve written one class that is called by a main form and an options form and whether they are interfering somehow is a possibility, though I cannot see how.

Code sample attached below.

Many thanks in advance


    ' Add files from the collection to a NeroFolder

    Folder = New NeroFolder
    intCounter = 1
    Do While intCounter <= colFiles.Count
        intCounter = intCounter + 1

    ' Create and configure the NeroISOTrack

    isoTrack = New NeroISOTrack
    isoTrack.Name = "Messages4U"
    isoTrack.RootFolder = Folder

    ' Retrieve the user-selected drive using .DeviceName

    drives = nero.GetDrives(NERO_MEDIA_TYPE.NERO_MEDIA_CDR)
    intCounter = 0
    Do While (intCounter < drives.Count) And (drives.Item(intCounter).DeviceName <> strSelectedDrive)
        intCounter = intCounter + 1
    drive = drives.Item(intCounter)

    ' Set the burn options selected by the user whilst verifying the drive capabilities

    intBurnFlags = 0
    intCapabilities = drive.Capabilities
    If bWriteCDText And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_CD_TEXT)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_CD_TEXT
    End If
    If bFinaliseCD And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_CLOSE_SESSION)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_CLOSE_SESSION
    End If
    If bWriteDAO And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_DAO)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_DAO
    End If
    If bDisableAbort And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_ABORT)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_ABORT
    End If
    If bDisableEject And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_EJECT)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_EJECT
    End If
    If bSimulate And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_SIMULATE)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_SIMULATE
    End If
    If bSpeedTest And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_SPEED_TEST)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_SPEED_TEST
    End If
    If bVerify And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_VERIFY)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_VERIFY
    End If
    If bWrite And (intCapabilities And (Not NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE)) Then
        intBurnFlags = intBurnFlags + NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE
    End If

    ' Retrieve the user-selected Speed

    intBurnSpeed = 0
    If drive.WriteSpeeds.Count = 0 Then
        intBurnSpeed = 1
        Do While (intCounter < drive.WriteSpeeds.Count) And (strSelectedDriveSpeed <> drive.WriteSpeeds.Item(intCounter).ToString)
            intCounter = intCounter + 1
        If strSelectedDriveSpeed = drive.WriteSpeeds.Item(intCounter).ToString Then
            intBurnSpeed = drive.WriteSpeeds.Item(intCounter)
        End If
    End If

    ' Write the CD

    drive.BurnIsoAudioCD("Messages4U", " ", 0, isoTrack, Nothing, Nothing, intBurnFlags, intBurnSpeed, NERO_MEDIA_TYPE.NERO_MEDIA_CD)

    ' return an error message if the burn fails

    If Not bBurnSuccessful Then
        BurnDisc = False
    End If

    ' Clear the NeroFiles collection

    For intCounter = 1 To colFiles.Count
    GoTo quit

OK, first dumb mistake - passing a NeroFile, when I should be passing NeroAudioTracks