B
Brian J
Please can anyone help a delegate newbie.
I am 'upgrading' some VB6 code ...
'UPGRADE_WARNING: Add a delegate for AddressOf MidiIN_Proc
midiError = midiInOpen(hMidiIN, mMPU401IN, AddressOf
MidiIN_Proc, 0, CALLBACK_FUNCTION)
and am getting the error ...
Method 'Public Sub MidiIN_Proc(hmIN As Integer, wMsg As Integer, dwInstance
As Integer, dwParam1 As Integer, dwParam2 As Integer)' does not have the
same signature as delegate 'Delegate Function MidiIN_Proc_Delegate(hmIN As
Integer, wMsg As Integer, dwInstance As Integer, dwParam1 As Integer,
dwParam2 As Integer) As Integer'.
definitions ...
Delegate Function MidiIN_Proc_Delegate( _
ByVal hmIN As Integer, ByVal wMsg As Integer, _
ByVal dwInstance As Integer, ByVal dwParam1 As Integer, _
ByVal dwParam2 As Integer) As Integer
Declare Function midiInOpen Lib "winmm.dll" ( _
ByRef lphMidiIn As Integer, ByVal uDeviceID As Integer, _
ByVal dwCallback As MidiIN_Proc_Delegate, ByVal dwInstance As
Integer, _
ByVal dwFlags As Integer) As Integer
Public Sub MidiIN_Proc(ByVal hmIN As Integer, ByVal wMsg As Integer, _
ByVal dwInstance As Integer, ByVal dwParam1 As Integer, _
ByVal dwParam2 As Integer)
I have read a lot of articles that seem to have confused the issue.
Can anyone point to where I am going wrong please?
I am 'upgrading' some VB6 code ...
'UPGRADE_WARNING: Add a delegate for AddressOf MidiIN_Proc
midiError = midiInOpen(hMidiIN, mMPU401IN, AddressOf
MidiIN_Proc, 0, CALLBACK_FUNCTION)
and am getting the error ...
Method 'Public Sub MidiIN_Proc(hmIN As Integer, wMsg As Integer, dwInstance
As Integer, dwParam1 As Integer, dwParam2 As Integer)' does not have the
same signature as delegate 'Delegate Function MidiIN_Proc_Delegate(hmIN As
Integer, wMsg As Integer, dwInstance As Integer, dwParam1 As Integer,
dwParam2 As Integer) As Integer'.
definitions ...
Delegate Function MidiIN_Proc_Delegate( _
ByVal hmIN As Integer, ByVal wMsg As Integer, _
ByVal dwInstance As Integer, ByVal dwParam1 As Integer, _
ByVal dwParam2 As Integer) As Integer
Declare Function midiInOpen Lib "winmm.dll" ( _
ByRef lphMidiIn As Integer, ByVal uDeviceID As Integer, _
ByVal dwCallback As MidiIN_Proc_Delegate, ByVal dwInstance As
Integer, _
ByVal dwFlags As Integer) As Integer
Public Sub MidiIN_Proc(ByVal hmIN As Integer, ByVal wMsg As Integer, _
ByVal dwInstance As Integer, ByVal dwParam1 As Integer, _
ByVal dwParam2 As Integer)
I have read a lot of articles that seem to have confused the issue.
Can anyone point to where I am going wrong please?