在创建的基于对话框的工程中,添加了ActiveMovie控件和一些打开、播放、暂停等按钮。通过打开按钮,向列表中添加了歌曲的路径字符串,点击播放按钮,却无法播放。但是添加了AfxMessageBox之后,点击完确定却开始播放。请大虾们指点呀~~!以下是OnPlay消息函数的代码:
CString PathName;
if(m_List.GetCurSel()!=-1)
{
m_List.GetText(m_List.GetCurSel(),PathName);
m_MusicName.SetWindowText(PathName);
}
else
{
m_List.GetText(m_List.GetTopIndex(),PathName);
m_MusicName.SetWindowText(PathName);
}
m_ActivePlayer.SetFileName(PathName);
// AfxMessageBox(PathName); m_ActivePlayer.Run();
SetTimer(1,20,NULL);
CString PathName;
if(m_List.GetCurSel()!=-1)
{
m_List.GetText(m_List.GetCurSel(),PathName);
m_MusicName.SetWindowText(PathName);
}
else
{
m_List.GetText(m_List.GetTopIndex(),PathName);
m_MusicName.SetWindowText(PathName);
}
m_ActivePlayer.SetFileName(PathName);
// AfxMessageBox(PathName); m_ActivePlayer.Run();
SetTimer(1,20,NULL);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货