IWMPMetadataPicture/getItemInfobyType() issues
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
IWMPMetadataPicture/getItemInfobyType() issues

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK
Author Message
Andy O'Meara
Guest





Posted: Sun Sep 05, 2004 1:21 am    Post subject: IWMPMetadataPicture/getItemInfobyType() issues Reply with quote

I'm trying to add cover art support into visual plugin that I author for WMP
10. So far I've got the IWMPMedia3 object, but when I call
getItemInfoByType() and try to use the VARIANT I get back as a
IWMPMetadataPicture*, I crash:

BSTR coverArtURL = NULL;
IWMPMetadataPicture* albumArt = NULL;

HRESULT result = Media3 -> getItemInfobyType( L"WM/Picture", NULL, 0,
(VARIANT*) &albumArt ); // the value of albumArt is junk
if ( albumArt && result == S_OK ) {
result = albumArt -> get_URL( &coverArtURL ); // crash
}


It's possible I'm doing something totally dumb? -- my primary platform is
Mac OS. If you see what I have wrong or if there's some sample code
out there that retrieves album cover art for the current track, then I'd love to
get a hold of it.

Thanks,
Andy

Back to top
Jim Travis [ms]
Guest





Posted: Wed Sep 08, 2004 6:52 am    Post subject: Re: IWMPMetadataPicture/getItemInfobyType() issues Reply with quote

Andy, as we discussed, a VARIANT is a struct union, so you have to
dereference it. The pdispVal member has an IDispatch pointer that you can QI
for IWMPMetadataPicture.

Hope that helps someone else as well.


--
Jim Travis
Microsoft Corp.
Windows Media Player SDK

Download:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/winmedia.asp

Latest online:
http://msdn.microsoft.com/library/en-us/wmplay10/mmp_sdk/windowsmediaplayer10sdk.asp

Please do not send email directly to this alias as this alias is for
newsgroup purposes only. This posting is provided "AS IS" with no
warranties, and confers no rights. You assume all risk for your use. © 2004
Microsoft Corporation. All rights reserved.

"Andy O'Meara" <andy55@ureach.com> wrote in message
news:614e01c492c5$227608f0$a501280a@phx.gbl...
I'm trying to add cover art support into visual plugin that I author for WMP
10. So far I've got the IWMPMedia3 object, but when I call
getItemInfoByType() and try to use the VARIANT I get back as a
IWMPMetadataPicture*, I crash:

BSTR coverArtURL = NULL;
IWMPMetadataPicture* albumArt = NULL;

HRESULT result = Media3 -> getItemInfobyType( L"WM/Picture", NULL, 0,
(VARIANT*) &albumArt ); // the value of albumArt is junk
if ( albumArt && result == S_OK ) {
result = albumArt -> get_URL( &coverArtURL ); // crash
}


It's possible I'm doing something totally dumb? -- my primary platform is
Mac OS. If you see what I have wrong or if there's some sample code
out there that retrieves album cover art for the current track, then I'd
love to
get a hold of it.

Thanks,
Andy
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