G
Guest
I'm having a problem calling waveInOpen from a VB.NET application, every time
I call it I get a return value of 11 which is MMSYSERR_INVALPARAM.
I can call waveInGetNumDevs and waveInGetDevCaps just fine. Below is the
format of the waveInOpen call and WaveFormatEx structure.
<DllImport("winmm.dll", SetLastError:=False, ExactSpelling:=True)> _
Public Shared Function waveInOpen(ByVal lphWaveIn As Int32 _
, ByVal uDeviceID As Int32 _
, ByRef lpFormat As APIStructures.WaveFormatEx _
, ByVal dwCallback As Int32 _
, ByVal dwInstance As Int32 _
, ByVal dwFlags As Int32) As Int32
End Function
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1)> _
Public Structure WaveFormatEx
Public FormatTag As Int16
Public Channels As Int16
Public SamplesPerSec As Int32
Public AvgBytesPerSec As Int32
Public BlockAlign As Int16
Public BitsPerSample As Int16
Public ExtraDataSize As Int16
End Structure
A sample solution is available upon request. Any help would be much
appreciated.
I call it I get a return value of 11 which is MMSYSERR_INVALPARAM.
I can call waveInGetNumDevs and waveInGetDevCaps just fine. Below is the
format of the waveInOpen call and WaveFormatEx structure.
<DllImport("winmm.dll", SetLastError:=False, ExactSpelling:=True)> _
Public Shared Function waveInOpen(ByVal lphWaveIn As Int32 _
, ByVal uDeviceID As Int32 _
, ByRef lpFormat As APIStructures.WaveFormatEx _
, ByVal dwCallback As Int32 _
, ByVal dwInstance As Int32 _
, ByVal dwFlags As Int32) As Int32
End Function
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1)> _
Public Structure WaveFormatEx
Public FormatTag As Int16
Public Channels As Int16
Public SamplesPerSec As Int32
Public AvgBytesPerSec As Int32
Public BlockAlign As Int16
Public BitsPerSample As Int16
Public ExtraDataSize As Int16
End Structure
A sample solution is available upon request. Any help would be much
appreciated.