Error mesage

vbimport

#1

Why i get error mesage on line:
Private Sub BuildFileFolderTree…folCurrent As Folder

Thanks


Option Explicit

Public WithEvents Nero As Nero

Public WithEvents Drive As NeroDrive

Dim Drives As INeroDrives
Dim Folder As INeroFolder
Dim Isotrack As NeroISOTrack
Dim File As NeroFile

Private Sub cmd_Abort_Click()
Nero.Abort
End Sub

'Recursive function to build the Folders/Files to burn

Private Sub BuildFileFolderTree(ByRef nroFolderToUse As NeroFolder, folCurrent As Folder) 'Here i get error mesage: User-defined type not defined

Dim folTMP As Folder
Dim filTMP As File
Dim nroFolTmp As NeroFolder
Dim nroFilTmp As NeroFile

'Add all files in the current directory
For Each filTMP In folCurrent.Files
Set nroFilTmp = New NeroFile
nroFilTmp.Name = filTMP.Name
nroFilTmp.SourceFilePath = filTMP.Path
nroFolderToUse.Files.Add nroFilTmp
Next

'Write the sub folders
For Each folTMP In folCurrent.SubFolders
Set nroFolTmp = New NeroFolder
nroFolTmp.Name = folTMP.Name
nroFolderToUse.Folders.Add nroFolTmp
Call BuildFileFolderTree(nroFolTmp, folTMP)
Next

End Sub

Private Sub cmd_Burn_Click()
Dim Source_Dir As String
Dim X As Boolean
Dim temp
Dim FSO As New FileSystemObject

Source_Dir = “C:\unison\bend”
lst_Messages.Clear

cmd_Abort.Enabled = True
cmd_Burn.Enabled = False

Set Folder = New NeroFolder
Set Drives = Nero.GetDrives(NERO_MEDIA_CDR)
Set Drive = Drives(lst_AvailableDevices.ListIndex)
Set Isotrack = New NeroISOTrack

Call BuildFileFolderTree(Folder, FSO.GetFolder(Source_Dir))

Isotrack.Name = “Unison”
Isotrack.RootFolder = Folder
Isotrack.BurnOptions = NERO_BURN_OPTION_CREATE_ISO_FS + NERO_BURN_OPTION_USE_JOLIET
If Drive.Capabilities And NERO_CAP_BUF_UNDERRUN_PROT Then
Drive.BurnIsoAudioCD “Unison”, “Backup”, 0, Isotrack, Nothing, Nothing, NERO_BURN_FLAG_WRITE + NERO_BURN_FLAG_BUF_UNDERRUN_PROT, 0, NERO_MEDIA_CD
Else
Drive.BurnIsoAudioCD “Unison”, “Backup”, 0, Isotrack, Nothing, Nothing, NERO_BURN_FLAG_WRITE, 0, NERO_MEDIA_CD
End If

End Sub

Private Sub Command1_Click()

End Sub

Private Sub drive_OnAborted(Abort As Boolean)
Abort = False
End Sub

Private Sub drive_OnAddLogLine(TextType As NEROLib.NERO_TEXT_TYPE, Text As String)
If Not SplitText(Text) Then
MsgBox “Error Splitting Message Data!”
End If
End Sub

Private Function SplitText(ByVal Data As String) As Boolean
Dim temp As String
Dim I As Integer

SplitText = False

temp = “”
For I = 1 To Len(Data)
If Mid$(Data, I, 1) = Chr$(13) Then
lst_Messages.AddItem Trim$(temp)
temp = “”
ElseIf Mid$(Data, I, 1) <> Chr$(10) Then
temp = temp + Mid$(Data, I, 1)
End If
Next
If temp <> “” Then
lst_Messages.AddItem Trim$(temp)
End If
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
SplitText = True

End Function

Private Sub drive_OnDoneBurn(StatusCode As NEROLib.NERO_BURN_ERROR)
Dim strMessages As String

If Not SplitText(Nero.ErrorLog) Then
MsgBox “Error Splitting Message Data!”
End If
If Not SplitText(Nero.LastError) Then
MsgBox “Error Splitting Message Data!”
End If

strMessages = "Burn finished "
If StatusCode <> NEROLib.NERO_BURN_OK Then
strMessages = strMessages + “NOT Successfully (” & StatusCode & “)”
Else
strMessages = strMessages + “Successfully”
End If

lst_Messages.AddItem strMessages
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
cmd_Abort.Enabled = False

cmd_Burn.Enabled = True
pgs_progress1.Value = 0

End Sub

Private Sub drive_OnDoneWaitForMedia(Success As Boolean)
lst_Messages.AddItem “Done waiting for media.”
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
End Sub

Private Sub drive_OnProgress(ProgressInPercent As Long, Abort As Boolean)
Abort = False
pgs_progress1.Value = ProgressInPercent
End Sub

Private Sub drive_OnSetPhase(Text As String)
If Not SplitText(Text) Then
MsgBox “Error Splitting Message Data!”
End If
End Sub

Private Sub Form_Initialize()
Dim myIndex As Integer
Set Nero = New Nero

pgs_progress1.Value = 0
lst_Messages.Clear

Set Drives = Nero.GetDrives(NERO_MEDIA_CDR)

For myIndex = 0 To Drives.Count - 1
lst_AvailableDevices.AddItem Drives(myIndex).DeviceName, myIndex
Next
'set to second item (normally would use first or allow to select?)
lst_AvailableDevices.ListIndex = 1
ErrHandler:
Exit Sub
End Sub

Private Sub nero_OnMegaFatal()
lst_Messages.AddItem “A mega fatal error has occurred.”
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
End Sub

Private Sub nero_OnNonEmptyCDRW(Response As NEROLib.NERO_RESPONSE)
lst_Messages.AddItem “CD-RW not empty!”
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
Response = NERO_RETURN_EXIT
End Sub

Private Sub nero_OnRestart()
lst_Messages.AddItem “The system is being restarted.”
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
End Sub

Private Sub nero_OnWaitCD(WaitCD As NEROLib.NERO_WAITCD_TYPE, WaitCDLocalizedText As String)
If Not SplitText(WaitCDLocalizedText) Then
MsgBox “Error Splitting Message Data!”
End If
End Sub

Private Sub nero_OnWaitCDDone()
lst_Messages.AddItem “Done waiting for CD.”
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
End Sub

Private Sub nero_OnWaitCDMediaInfo(LastDetectedMedia As NEROLib.NERO_MEDIA_TYPE, LastDetectedMediaName As String, RequestedMedia As NEROLib.NERO_MEDIA_TYPE, RequestedMediaName As String)
lst_Messages.AddItem “Waiting for a particular media type:”
If Not SplitText(RequestedMediaName) Then
MsgBox “Error Splitting Message Data!”
End If
End Sub

Private Sub nero_OnWaitCDReminder()
lst_Messages.AddItem “Still waiting for CD…”
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
End Sub