灾难性故障(HRESULT的异常:0x8000FFFF)使用axwindowsMediaPlayer创建播放列表 [英] Catastrophic failure (Exception from HRESULT: 0x8000FFFF) creating a playlist with axwindowsMediaPlayer

查看:589
本文介绍了灾难性故障(HRESULT的异常:0x8000FFFF)使用axwindowsMediaPlayer创建播放列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用axwindowsMediaPlayer对象在winform中显示视频。

I am using the axwindowsMediaPlayer object to show videos in a winform. In particular I want to play a playlist.

在我的电脑(win7)上一切正常,在使用winXP的另一台电脑上也能正常工作(最终版的电脑用户)。

Everything works fine on my pc (win7) and used to work fine also in another pc with winXP (the pc of the final user).

但是几天前发生了一些事情:在XP PC上,我开始收到以下提示

But something happened a couple of days ago: on the XP PC I started to receive the following expcetion

Unhandled Exception:

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

System.Runtime.InteropServices.COMException

Stack Trace:
   at WMPLib.IWMPPlaylistCollection.newPlaylist(String bstrName)
   at BrinaS941.ScreenSaverVideo.ScreenSaver_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

在这里出现异常的代码:

Here the code that rises the exception:

private void ScreenSaverVideo_Load(object sender, EventArgs e)
{
    WMPLib.IWMPPlaylist playlist = VideoPlayer.playlistCollection.newPlaylist("myplaylist");
    WMPLib.IWMPMedia media;
    VideoPlayer.uiMode = "none";
    VideoPlayer.settings.volume = 10;
    [....]

在应用程序运行时开始出现异常

The exception started to be risen while the application was working and now keep on having the same behavior.

我尝试在XP计算机上重新安装Windows Media Player(11),但没有任何变化。

I tried to reinstall Windows Media Player (11) on the XP machine, but nothing changed.

更新:

我试图注释与播放列表相关的部分代码(并使用 URL方法将视频设置为想玩),一切正常。我真的很困惑...

I tried to comment the part of code related to the playlist (and use the method "URL" to set the video a want to play) and everything works fine. I am really puzzled...

任何帮助将不胜感激。
谢谢

Any help would be really appreciated. Thanks

推荐答案

我终于找到了问题!

我的错不是一旦使用就删除播放列表(使用IWMPPlaylistCollection :: remove方法
)。我意识到我的文件系统中有2000个播放列表(myplaylist.wpl,myplaylist(1).wpl,...,myplaylist(1999).wpl),大概有2000个限制。

My fault was not to remove the playlist once used (with IWMPPlaylistCollection::remove method ). I realized that I had 2000 playlists ( myplaylist.wpl, myplaylist(1).wpl,..., myplaylist(1999).wpl) in my file system and probably there is a limit of 2000.

我不知道这是文件系统还是WMP的限制。

I don't know if it's a limit of the file system or of WMP.

一旦删除了所有文件,一切便重新开始工作。

Once deleted all the files everything started working again.

感谢大家的帮助!

这篇关于灾难性故障(HRESULT的异常:0x8000FFFF)使用axwindowsMediaPlayer创建播放列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆