I have a VB.Net app that uses NeroCOM which runs fine on my development machine. I have a production environment where I have installed Nero 6, but when I install my app I get an InvalidCastException from the following code:
m_DVDControl = New NeroClass Dim devices As NeroDrives devices = m_DVDControl.GetDrives(NERO_MEDIA_TYPE.NERO_MEDIA_DVD_M Or NERO_MEDIA_TYPE.NERO_MEDIA_DVD_P) If devices.Count > 0 Then m_DVDDrive = CType(devices.Item(0), NeroDrive) Else LogText("Unable to find DVD burner") End If Dim drives As NeroDrives = m_DVDControl.GetDrives(NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY) For i As Integer = 0 To drives.Count - 1 If drives.Item(i).Capabilities = (drives.Item(i).Capabilities Or NERO_CAPABILITIES.NERO_CAP_IMAGE_RECORDER) Then m_ImageRecorder = CType(drives.Item(i), NeroDrive) End If Next If m_ImageRecorder Is Nothing Then LogText("Unable to find image recording device") End If
I copied the NeroFiddlesCOM.NET app to my production environment and it runs fine. I tried to set up the references in my VB.Net the same as in NeroFiddlesCOM.NET – one reference to Interop.NEROLib.dll and one reference to Interop.NeroVisionAPI.dll. I copied these files out of the NeroFiddlesCOM.NET folder because I couldn’t find NeroLib.dll or NeroVisionAPI.dll. For some reason in my project the references say Interop.NEROLib and Interop.NeroVisionAPI whereas in the NeroFiddlesCOM.NET they just say NEROLib and NeroVisionAPI.
I can’t find NeroLib.dll or NeroVisionAPI.dll on my pc or in the nero sdk folder (v1.06). I’m guessing that maybe I need to tell .NET to reference these, and it will generate the Interop automatically?
On a side note, the NeroCOM documentation is way too sparse and the NeroFiddlesCOM.NET sample doesn’t even exercise all the NeroCOM functionality. All the other DVD burning libraries I’ve used make sure to exercise all functionality in the sample programs so that its completely clear how things work. The NeroFiddlesCOM.NET doesn’t even have functionality for selecting a group of files to burn to DVD – you must start from an image or an existing disc.