I know, there are a ton of threads devoted to this, but I can't seem to figure out what's wrong. It's driving me quite batty.
The situation: Nero 6.6 (Downloaded the latest a couple days ago), therefore NeroCOM 1.3. The program is a simple backup program that burns multisession backups to CD or DVD. I can burn, I can gather files, I can even burn multisession CDs. DVDs, however, are tricky. At first, I didn't even know about the need for VMS, but now that I've put the code for VMS detection in, I still can't create multisession DVDs. The first burn works just fine. The second burn fires OnNonEmptyCDRW.
I've debugged a ton, and I've figured out that my code does successfully import the previous session (I can walk through the NeroFolder and print out the contents), it just won't burn a second session.
I think I'm operating on a less than full knowledge of the NerCOM API. I've got the SDK documentation, but that doesn't have anything on multisession. The only thing I can think of is that there's a problem with the actual call to BurnIsoAudioCD itself. Perhaps the flags, perhaps the burn options, perhaps other arguments. Note, for example, that I set CDExtra to False. What does that do, exactly? I can't find any documentation on it, and I've searched the threads here. The same goes for CDStamp. I pass Nothing since that's what every example does, but why? What's it good for? I capture it in OnDoneImport2, but never use it.
What am I doing wrong?
Anyway, here is the relevant code. Variable names are pretty descriptive, so I won't bother with the declarations. Trust me when I say they're type correct. I've stripped out some error checking code, and extraneous stuff not relevant to my problem. Code is in VBA (MS Access 2003):
' the "DoBurn" method is actually a condensation of several scattered
' methods -- I don't want to clutter the thread too much.
Private Sub DoBurn()
BurnOptions = NERO_BURN_OPTION_CREATE_ISO_FS _
+ NERO_BURN_OPTION_USE_JOLIET _
' I added mode 2 as part of my debugging. not sure
' what it adds, really.
BurnFlags = NERO_BURN_FLAG_WRITE _
+ NERO_BURN_FLAG_DETECT_NON_EMPTY_CDRW _
' CD_TEXT was also added during debugging. I'm also
' not sure what it does.
If Not Finalize Then
BurnFlags = BurnFlags + NERO_BURN_FLAG_CLOSE_SESSION
' Finalize is a user option, but I am 100% certain it's not set
' (and therefore I only close the session, not the whole disc)
' during my first burn.
If Drive.Capabilities And NERO_CAP_BUF_UNDERRUN_PROT <> 0 Then
BurnFlags = BurnFlags + NERO_BURN_FLAG_BUF_UNDERRUN_PROT
' defined below -- loads CD information
If CDInfo.Tracks.Count > 0 Then
' defined below -- imports previous sessions
Set BurnRootFolder = buildFileList
' builds files from filesystem and imported session
DoneBurn = False
Set isoTrack = new NeroISOTrack
isoTrack.Name = BurnTitle
isoTrack.RootFolder = BurnRootFolder
isoTrack.BurnOptions = BurnOptions
Drive.BurnIsoAudioCD BurnTitle, SessionTitle, False, isoTrack, _
Nothing, Nothing, BurnFlags, _
' 0 selects fastest speed. Last argument
' selects to burn whatever happens
' to be in the drive at the moment.
' For my tests, I've been using DVD-RW
Do While Not DoneBurn
Private Sub importCD()
DoneImport = False
If CDInfo.MediumFlags And NCDIMF_VIRTUALMULTISESSION <> 0 Then
Dim vmi as NeroVMSInfo
Dim VMS as NeroVMSSession
Set vmi = drive.GetVMSInfo
Drive.ImportIsoTrack vmi.Count - 1, NERO_IMPORT_VMS_SESSION
Drive.ImportIsoTrack CDInfo.Tracks.Count - 1, _
Do While Not DoneImport
Private Sub loadCDInfo()
DoneCDInfo = False
Do While Not DoneCDInfo
Private Sub Drive_OnDoneBurn(StatusCode As NEROLib.NERO_BURN_ERROR)
DoneBurnStatus = StatusCode
DoneBurn = True
Private Sub Drive_OnDoneCDInfo(ByVal pCDInfo As NEROLib.INeroCDInfo)
Set CDInfo = pCDInfo
DoneCDInfo = True
Private Sub Drive_OnDoneImport2(ByVal bOK As Boolean, ByVal pFolder As NEROLib.INeroFolder, _
ByVal pCDStamp As NEROLib.INeroCDStamp, _
ByVal pImportInfo As NEROLib.INeroImportDataTrackInfo, _
ByVal importResult As NEROLib.NERO_IMPORT_DATA_TRACK_RESULT)
If bOK Then
Set BurnRootFolder = pFolder
Set ImportedCDStamp = pCDStamp
BurnTitle = pImportInfo.VolumeName
MsgBox "Error Importing"
DoneImport = True