Andy O'Meara
Guest
|
Posted:
Sun Sep 05, 2004 1:21 am Post subject:
IWMPMetadataPicture/getItemInfobyType() issues |
|
|
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
|
|
Jim Travis [ms]
Guest
|
Posted:
Wed Sep 08, 2004 6:52 am Post subject:
Re: IWMPMetadataPicture/getItemInfobyType() issues |
|
|
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 |
|