2 u014714012 u014714012 于 2014.07.26 13:01 提问

如何解决异常来自 HRESULT:0xC00D1054
c#

oid axPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{
//当一首歌播放完之后就不会再记录了
// temp1 += axPlayer.playState.ToString() + "\n";
lbPlayState.Text += axPlayer.playState.ToString() + "\n"; ;
if (lSongs.Count == 0)
{
return;
}
if (axPlayer.playState == WMPLib.WMPPlayState.wmppsMediaEnded)
{
//此时实现下一曲的选择,并为URL赋值
//得现在的序号
int temp = listSongPlayer.SelectedIndex;
temp++;
if (temp > lSongs.Count - 1)
{
listSongPlayer.SelectedIndex = 0;
axPlayer.URL = lSongs[0];
}
else
{

                listSongPlayer.SelectedIndex = temp;
                axPlayer.URL = lSongs[temp];
            }
        }
        if (axPlayer.playState == WMPLib.WMPPlayState.wmppsReady)
        { 
        //播放歌曲的功能
axPlayer.Ctlcontrols.play();  // 异常来自 HRESULT:0xC00D1054         

        }
     }

4个回答

wpk8023
wpk8023   2015.05.21 16:05

请问解决了吗?我也遇到这个问题了

xs1994007001
xs1994007001   2015.10.05 17:14

上面的方法不行还有没其他答案?

xs1994007001
xs1994007001   2015.10.05 17:15

上面的方法不行还有没其他答案?

yunqifa
yunqifa   2015.06.23 13:39

我也出现了这个问题,只不过解决了,可以试试把if (axPlayer.playState == WMPLib.WMPPlayState.wmppsReady),换成else if (axPlayer.playState == WMPLib.WMPPlayState.wmppsReady)

liuxiaohui320
liuxiaohui320 这个方法不行,你是怎么解决的呢
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片