Thanks Unison, The Nero version is 6.6.06 Actually, I think I used your code from somewhere in the forum, I must tripped somewhere. Basically, I’m creating a DLL which I can include in my applications, so I can use the CD burning capability. Once done, I will post the complete code here… Thanks for your help
. Here is the code realted to Nero:
Private Sub InitializeNERO()
Dim sTmp As String
On Error GoTo ErrorHandler
Open App.Path & "\NeroDll.ini" For Input As #1
Line Input #1, sTmp
lblDrive.Caption = Trim(sTmp)
Line Input #1, sTmp
lblDrive.Tag = Trim(sTmp)
Close #1
Set Nero = New Nero
Set lstNDrive = Nero.GetDrives(NERO_MEDIA_CDRW)
Exit_Sub:
Exit Sub
ErrorHandler:
If Err.Number = 53 Then
If iLanguage = eLang.eEnglish Then
MsgBox “No drive has been set”
Else
MsgBox “Aucun bruleur n’a été sélectionné”
End If
Err.Clear
Unload Me
End If
End Sub
Private Sub BuildFileFolderTree(ByRef nroFolderToUse As NeroFolder, ByRef folCurrent As Folder)
Dim folTMP As Folder
Dim filTMP As File
Dim nroFolTMP As NeroFolder
Dim nroFilTMP As NeroFile
For Each filTMP In folCurrent.Files
Set nroFilTMP = New NeroFile
nroFilTMP.Name = filTMP.Name
nroFilTMP.SourceFilePath = filTMP.Path
nroFolderToUse.Files.Add nroFilTMP
Next filTMP
For Each folTMP In folCurrent.SubFolders
Set nroFolTMP = New NeroFolder
nroFolTMP.Name = folTMP.Name
nroFolderToUse.Folders.Add nroFolTMP
Call BuildFileFolderTree(nroFolTMP, folTMP)
Next folTMP
End Sub
Private Sub BurnCD()
Dim Folder As NeroFolder
Dim sSource_Dir As String
Dim FSO As New FileSystemObject
Dim DateFolder As NeroFolder
Dim i As Integer
Dim result
Set NDrv = lstNDrive(CLng(lblDrive.Tag))
sSource_Dir = "c: emp"
'Multisession
isDriveFinished = False
NDrv.CDInfo NERO_READ_ISRC
While Not isDriveFinished
DoEvents
Wend
If iNbSession > 0 Then
i = iNbSession - 1
isDriveFinished = False
NDrv.ImportIsoTrack i, NERO_IMPORT_ISO_ONLY
While Not isDriveFinished
DoEvents
Wend
End If
Set Folder = New NeroFolder
Set DateFolder = New NeroFolder
Set ISOTrack = New NeroISOTrack
DateFolder.Name = "Back " & Format(Date, "yyyy-mm-dd") & ":" & _
Format(Time, "hh:mm:ss")
Folder.Folders.Add DateFolder
Call BuildFileFolderTree(DateFolder, FSO.GetFolder(sSource_Dir))
ISOTrack.Name = "Never"
ISOTrack.RootFolder = Folder
ISOTrack.BurnOptions = NERO_BURN_OPTION_CREATE_HFS_FS + _
NERO_BURN_OPTION_USE_JOLIET
'NDrv.BurnIsoAudioCD "Never", "Backup", 0, ISOTrack, Nothing, Nothing, _
NERO_BURN_FLAG_WRITE + NERO_BURN_FLAG_CLOSE_SESSION, 0, _
NERO_MEDIA_CD
NDrv.BurnIsoAudioCD "Pearson", "(c)2005", 0, ISOTrack, Nothing, Nothing, _
NERO_BURN_FLAG_WRITE + NERO_BURN_FLAG_CLOSE_SESSION + _
NERO_BURN_FLAG_DISABLE_EJECT, 0, NERO_MEDIA_CD
End Sub
Private Sub NDrv_OnProgress(ProgressInPercent As Long, Abort As Boolean)
pBar(0).Value = ProgressInPercent
DoEvents
End Sub
Private Sub NDrv_OnSubTaskProgress(ProgressInPercent As Long, Abort As Boolean)
pBar(1).Value = ProgressInPercent
DoEvents
End Sub
Private Sub NDrv_OnAddLogLine(TextType As NEROLib.NERO_TEXT_TYPE, Text As String)
AddToLog Text, Process
End Sub
Private Sub NDrv_OnDoneBurn(StatusCode As NEROLib.NERO_BURN_ERROR)
If StatusCode = NERO_BURN_OK Then
AddToLog “Burning completed with success”, Process
Else
AddToLog “An error occure:” & StatusCode, FatalError
End If
isDriveFinished = True
End Sub
Private Sub NDrv_OnDoneWaitForMedia(Success As Boolean)
AddToLog “Done waiting for media”, Process
End Sub
Private Sub NDrv_OnSetPhase(Text As String)
AddToLog Text, Process
End Sub
Private Sub Nero_OnNonEmptyCDRW(Response As NEROLib.NERO_RESPONSE)
AddToLog “Please inser a blank CDRW”, Warning
End Sub
Private Sub Nero_OnWaitCD(WaitCD As NEROLib.NERO_WAITCD_TYPE, WaitCDLocalizedText As String)
AddToLog WaitCDLocalizedText, Warning
End Sub
Private Sub NDrv_OnDoneCDInfo(ByVal pCDInfo As NEROLib.INeroCDInfo)
isDriveFinished = True
End Sub
Private Sub NDrv_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 lstNFolder = pFolder
Else
AddToLog “Error Reading Data”, FatalError
End If
isDriveFinished = True
End Sub