L
LongShotBuddy
Howdy,
I've tried everything (but the right thing obviously) to get the
following to work, I'm sure it has something to do with the changes
from VB6 to .net, but sure has me stumped, any suggestions? It's not
populating the WAVEOUTCAPS structure, and GetLastError returns "Error
#126"
Thanks!
Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Integer
Declare Function waveOutGetDevCaps Lib "winmm.dll"_
Alias "waveOutGetDevCapsA" (ByVal uDeviceID As_
Integer, ByVal lpCaps As WAVEOUTCAPS, ByVal_
uSize As Integer) As Integer
(snip)
Private Const MAXPNAMELEN = 32
Structure WAVEOUTCAPS
Public wMid As Int16 ' integer
Public wPid As Int16 ' integer
Public vDriverVersion As Int32 ' long
<VBFixedString(MAXPNAMELEN)> Public szPname As String
Public dwFormats As Int32 ' long
Public wChannels As Int16 ' integer
Public dwSupport As Int32 ' long
End Structure
(snip)
Public Shared Sub GetWaveOutDevices()
Dim NumDevs As Integer
Dim WaveFormat As WAVEOUTCAPS
Dim i As Integer
Dim result As Integer
NumDevs = waveOutGetNumDevs()
For i = 0 To NumDevs - 1
result = (waveOutGetDevCaps(i, WaveFormat,
Len(WaveFormat)))
'(result = 0)
Next
End sub
I've tried everything (but the right thing obviously) to get the
following to work, I'm sure it has something to do with the changes
from VB6 to .net, but sure has me stumped, any suggestions? It's not
populating the WAVEOUTCAPS structure, and GetLastError returns "Error
#126"
Thanks!
Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Integer
Declare Function waveOutGetDevCaps Lib "winmm.dll"_
Alias "waveOutGetDevCapsA" (ByVal uDeviceID As_
Integer, ByVal lpCaps As WAVEOUTCAPS, ByVal_
uSize As Integer) As Integer
(snip)
Private Const MAXPNAMELEN = 32
Structure WAVEOUTCAPS
Public wMid As Int16 ' integer
Public wPid As Int16 ' integer
Public vDriverVersion As Int32 ' long
<VBFixedString(MAXPNAMELEN)> Public szPname As String
Public dwFormats As Int32 ' long
Public wChannels As Int16 ' integer
Public dwSupport As Int32 ' long
End Structure
(snip)
Public Shared Sub GetWaveOutDevices()
Dim NumDevs As Integer
Dim WaveFormat As WAVEOUTCAPS
Dim i As Integer
Dim result As Integer
NumDevs = waveOutGetNumDevs()
For i = 0 To NumDevs - 1
result = (waveOutGetDevCaps(i, WaveFormat,
Len(WaveFormat)))
'(result = 0)
Next
End sub