IWMHeaderInfo::GetAttributeByIndex return 'buffer too small"
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
IWMHeaderInfo::GetAttributeByIndex return 'buffer too small"

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK
Author Message
bzirk
Guest





Posted: Thu Sep 16, 2004 11:19 pm    Post subject: IWMHeaderInfo::GetAttributeByIndex return 'buffer too small" Reply with quote

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

Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB