Nope none of them actually works. I keep getting this type of error....
Any other ideas?
Edit:
I have done some further testing and heres what I found out:
In a test program, the VST DLL works fine, just not in my main project:
The code of the test program:
VSTInstrumentChannel = BassVst.BASS_VST_ChannelCreate(44100, 2, "C:\Sketch Trumpet.instruments\Sketch Trumpet.dll", 0)
Bass.BASS_ChannelPlay(VSTInstrumentChannel, False)
Dim vstInfo As New BASS_VST_INFO()
If BassVst.BASS_VST_GetInfo(VSTInstrumentChannel, vstInfo) AndAlso vstInfo.hasEditor Then
Dim f As New Form()
f.Width = vstInfo.editorWidth + 4
f.Height = vstInfo.editorHeight + 34
AddHandler f.Closing, AddressOf Form1_Closing
f.Text = vstInfo.effectName
f.Show()
BassVst.BASS_VST_EmbedEditor(VSTInstrumentChannel, f.Handle)
Else
MessageBox.Show("No Editor!!")
End If
The code of the main project:
Dim OKVM = New OKDialogViewModel
Dim vstInfo As New BASS_VST_INFO()
Bass.BASS_ChannelPlay(VSTInstrumentChannel, False)
If BassVst.BASS_VST_GetInfo(VSTInstrumentChannel, vstInfo) Then
If vstInfo.hasEditor Then
EmptyVM = New ViewModel.EmptyViewModel("Instrument " & CStr(WhichInstance + 1) & ": " & vstInfo.effectName, VSTInstrumentChannel, ChosenInstrument, Me)
WindowHandle = WindowService.OpenPlugInWindow("Instrument " & CStr(WhichInstance + 1) & ": " & vstInfo.effectName, vstInfo.editorHeight + 28, vstInfo.editorWidth, EmptyVM, Me)
EmptyVM.UIHandles = WindowHandle
If UIOpen Then
OKVM = New OKDialogViewModel
OKVM.Meldung = "UI already open."
dialogService.ShowModalDialog("", OKVM, Me, True, False, Services.WindowStyle.None, Services.ResizeMode.NoResize, 500, Services.SizeToContent.Height, Services.WindowStartupLocation.CenterOwner, "")
Else
BassVst.BASS_VST_EmbedEditor(VSTInstrumentChannel, WindowHandle(0))
UIOpen = True
ChosenInstrument.UIOffen = True
End If
End If
Else
OKVM = New OKDialogViewModel
OKVM.Meldung = "No User-Interface."
dialogService.ShowModalDialog("", OKVM, Me, True, False, Services.WindowStyle.None, Services.ResizeMode.NoResize, 500, Services.SizeToContent.Height, Services.WindowStartupLocation.CenterOwner, "")
End If
I also tried that with Declare Function BASS_VST_HasEditor as you described and then it works, but when it comes to EmbdeEditor the error will happen again.
So I did the same thing with Declare Function BASS_VST_EmbedEditor but still the error shows up...
I also gave you some wrong information, sorry about that:
When I do this:
If BassVst.BASS_VST_GetInfo(VSTInstrumentChannel, vstInfo) Then
If vstInfo.hasEditor Then
The error occurs in the first line.