CATSTROPHIC FAILURE (WMPlayer Interop)

B

Blair Allen Stark

The weirdest problem. . .

heres my code:

============================

public enum AudioLookup
{
Artist, Album,
}

public enum CollectionType
{
Audio, Video,
}
public IList<string> ItemList(AudioLookup itemType, CollectionType
collType)
{
IList<string> result = new List<string>();
WMPLib.IWMPLibraryServices libserv = wmp_ as IWMPLibraryServices;
if (libserv == null)
throw new NullReferenceException("Library Not Initialized");
WMPLibraryType libTypes = WMPLibraryType.wmpltLocal;
int lNct = libserv.getCountByType(libTypes);
for (int n = 0; n < lNct; n++)
{
IWMPLibrary lib = libserv.getLibraryByType(libTypes, n);
IWMPStringCollection2 col =
lib.mediaCollection.getAttributeStringCollection(itemType.ToString(),
collType.ToString()) as IWMPStringCollection2;
for (int i = 0; i < col.count; i++)
{
result.Add(col.getItemInfo(i, itemType.ToString()));
}
}
return result;
}
============================

at the line

int lNct = libserv.getCountByType(libTypes);

I get the catastrophic failure:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

if I set a breakpoint on the line and then do an inspect of libserv, it
succeeds

any idea whats going on?
 
J

Jialiang Ge [MSFT]

Hello Blair,

For all WMI SDK-related issues, I would suggest posting in the newsgroup
below:

microsoft.public.windowsmedia.sdk

The reason why we recommend posting appropriately is you will get the most
qualified pool of respondents, and other partners who the newsgroups
regularly can either share their knowledge or learn from your interaction
with us. Thank you for your understanding.

But please notice that the newsgroup 'microsoft.public.windowsmedia.sdk' is
not managed by Microsoft, so a timely response cannot be guaranteed.
The link http://msdn2.microsoft.com/en-us/subscriptions/aa974230.aspx lists
all the MSDN managed newsgroups for your reference.

Have a nice day!

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top