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?
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?