我使用axwindowsMediaPlayer对象在winform中显示视频.特别是我想播放一个播放列表.
我的电脑上的一切正常(win7),并且在另一台带有winXP(最终用户的电脑)的电脑上工作也很好.
但事情发生在几天前:在XP PC上我开始收到以下的说明
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)
Run Code Online (Sandbox Code Playgroud)
这里引发异常的代码:
private void ScreenSaverVideo_Load(object sender, EventArgs e)
{
WMPLib.IWMPPlaylist playlist = VideoPlayer.playlistCollection.newPlaylist("myplaylist");
WMPLib.IWMPMedia …Run Code Online (Sandbox Code Playgroud)