Adding WM_PICTURE via IWMHeaderInfo3::AddAttribute fails
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
Adding WM_PICTURE via IWMHeaderInfo3::AddAttribute fails

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





Posted: Tue Dec 27, 2005 1:30 pm    Post subject: Adding WM_PICTURE via IWMHeaderInfo3::AddAttribute fails Reply with quote

Hello!

I'm trying to add a WM_PICTURE attribute via
IWMHeaderInfo3::AddAttribute
and it fails randomly with E_POINTER.

When I take 5 files to add cover art, it works sometimes works for 3,
sometimes for all, sometimes for no file.


This is what I'm doing:

extern IWMHeaderInfo3* pHeaderInfo
extern BYTE* pCoverData;
extern unsigned coverSize;

WORD dataIdx = 0;
HRESULT hr = S_OK;

WM_PICTURE* pWMCover = new WM_PICTURE();
pWMCover->bPictureType = 0;
pWMCover->dwDataLen = coverSize;
pWMCover->pbData = new BYTE[coverSize];
::memcpy(pWMCover->pbData, pCoverData, coverSize);
pWMCover->pwszDescription = ::_tcsdup(_T("Test"));
pWMCover->pwszMIMEType = ::_tcsdup(_T("Test"));

unsigned attrSize = pWMCover->dwDataLen;
attrSize += ::_tcslen(pWMCover->pwszDescription) + 1) * sizeof(WCHAR);
attrSize += ::_tcslen(pWMCover->pwszMIMEType) + 1 ) * sizeof(WCHAR);
attrSize += sizeof(WM_PICTURE);

hr = pHeaderInfo->AddAttribute(0x0,
g_wszWMPicture, &dataIdx, WMT_TYPE_BINARY, 0,
reinterpret_cast<BYTE*>(pWMCover), attrSize);

The pointer pCoverData and the corresponding coverSize are valid, btw.

Can anyone point me to the right direction?

Thank you!

Best regards,
~ Florian Heidenreich

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