I am trying to call the acmStreamPrepareHeader function in the msacm32.dll
library as follows:
Public Declare Auto Function acmStreamPrepareHeader Lib "msacm32.dll" (ByVal
has As IntPtr, ByRef pash As sACMSTREAMHEADER, ByVal fdwPrepare As Int32) As
Int16
mmr = acmStreamPrepareHeader(hstr, strhdr, 0)
where hstr is an IntPtr returned by a preceding acmStreamOpen call and
strhdr is defined as:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> Public
Structure sACMSTREAMHEADER
Dim cbStruct As Int32
Dim fdwStatus As Int32
Dim dwUser As Int32
Dim pbSrc As Int32
Dim cbSrcLength As Int32
Dim cbSrcLengthUsed As Int32
Dim cbSrcUser As Int32
Dim pbDst As Int32
Dim cbDstLength As Int32
Dim cbDstLengthUsed As Int32
Dim dwDstUser As Int32
Dim dwReservedDriver As Int32
End Structure
and initialized as follows:
Dim strhdr As sACMSTREAMHEADER
strhdr.cbStruct = Marshal.SizeOf(strhdr)
strhdr.fdwStatus = 0
strhdr.pbSrc = pSrcWaveData.ToInt32
strhdr.cbSrcLength = SrcWaveData.Length
strhdr.pbDst = pDstWaveData.ToInt32
strhdr.cbDstLength = pdwOutputBytes
where pSrcWaveData is given by
pSrcWaveData = Marshal.AllocHGlobal(SrcWaveData.Length)
and pDstWaveData is given by
pDstWaveData = Marshal.AllocHGlobal(pdwOutputBytes)
SrcWaveData is a byte array.
The call to acmSteamPrepareHeader always return mmr=11, which is 'one or
more invalid parameters' What am I missing?
Ken Halter - 31 Aug 2004 21:10 GMT
> I am trying to call the acmStreamPrepareHeader function in the msacm32.dll
> library as follows:
Sorry. Wrong group. If that's .Net code, you'll have better luck getting
.Net related answers in a .Net group. They all have "dotnet" or "vsnet"
in their names.

Signature
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..