Re: IWMHeaderInfo::GetAttributeByIndex fails with 'buffer too small'
From: ccallen (ccallen_at_windowpane.com)
Date: 09/17/04
- Next message: Leesei: "waveOutGetPosition"
- Previous message: ozjohn: "Mirror images of Webcam video"
- In reply to: bzirk: "IWMHeaderInfo::GetAttributeByIndex fails with 'buffer too small'"
- Next in thread: bzirk: "Re: IWMHeaderInfo::GetAttributeByIndex fails with 'buffer too smal"
- Reply: bzirk: "Re: IWMHeaderInfo::GetAttributeByIndex fails with 'buffer too smal"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Sep 2004 19:04:36 -0700
Hmmm,
Here is something else to try. This takes the aproach of converting the app
to vb and using the orginal C# wrapper.
Create a new vb.net application.
Reference the orginal csharp wrapper.
Cut & past the C# ShowAttributes function into the VB app and translate it
to VB. For a quick test, just hard code the name and stream number into your
code.
Did that work?
Because it gets compiled and refenced from your app, the wrapper can be in
any language. The typical method to create a PIA is to muck around with IL.
And this is a pretty big typelib to create it by hand, like the MetadataEdit
sample does.
Conan
Using the orginal c# wrapper.
"bzirk" <bzirk@discussions.microsoft.com> wrote in message
news:10885CFD-50BA-48E5-95F4-0298C17FCCEC@microsoft.com...
> I have translated the WMFSDKWrapper from the managed code example in
> WMFSDK95. I can succuessfully open ASF files, but when I attempt to
iterate
> through the attributes using IWMHeaderInfo::GetAttributeByIndex it throws
a
> ComException with an HRESULT of 0xC00D07D1 which I believe is
> ASF_E_BUFFERTOOSMALL.
>
> The GetAttributeByIndex functions is defined as follows:
>
> Function GetAttributeByIndex( _
> ByVal wIndex As UInt16, _
> ByRef wStreamNum As UInt16, _
> <MarshalAs(UnmanagedType.LPWStr)> ByRef wszName As String, _
> ByRef cchNameLen As UInt16, _
> ByRef [Type] As WMT_ATTR_DATATYPE, _
> <MarshalAs(UnmanagedType.LPArray)> ByRef Value As Byte(), _
> ByRef cbLength As UInt16) As UInt32
>
> As suggested in the WMFSDK documentation, the first call is to retrieve
the
> sizes of the wszName string and Value byte arrary. That call is as
follows:
>
> Dim mmr As UInt32
> Dim wIndex As UInt16 = Convert.ToUInt16(i)
> Dim wStreamNum As UInt16 = Convert.ToUInt16(0)
> Dim wAttribType As WMSDK.WMFSDKWrapper.WMT_ATTR_DATATYPE
> Dim ccNameLen As UInt16 = Convert.ToUInt16(0)
> Dim cbLength As UInt16 = Convert.ToUInt16(0)
>
> mmr = hdr.GetAttributeByIndex(wIndex, wStreamNum, Nothing,
> ccNameLen, wAttribType, Nothing, cbLength)
>
> where i in the first pass is zero. The first call fails with the
> aforementioned ComException. Any ideas?
>
> Thanks,
>
> BZ
>
>
>
>
- Next message: Leesei: "waveOutGetPosition"
- Previous message: ozjohn: "Mirror images of Webcam video"
- In reply to: bzirk: "IWMHeaderInfo::GetAttributeByIndex fails with 'buffer too small'"
- Next in thread: bzirk: "Re: IWMHeaderInfo::GetAttributeByIndex fails with 'buffer too smal"
- Reply: bzirk: "Re: IWMHeaderInfo::GetAttributeByIndex fails with 'buffer too smal"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|