程序不知道是哪个地方出了错,请高手赐教!
void CSpernView::OnPlayfile()
{
// TOD Add your command handler code here
RECT Srct,Prct;
int width;
UINT Sid;
UINT SStyle;
CMainFrame* pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd;
if(!pVideoPlay)
pVideoPlay=new CVideoPlay(this->m_hWnd);
pFrame->m_wndStatusBar.SetPaneText(0,"播放");
pFrame->m_wndStatusBar.GetPaneInfo(0,Sid,SStyle,width);
::GetClientRect(pFrame->m_wndStatusBar.m_hWnd,&Srct);
Prct.left=40;
Prct.top=4;
Prct.right=width;
Prct.bottom=Srct.bottom-1;
m_prog.Create(PBS_SMOOTH,Prct,&pFrame->m_wndStatusBar,105);
pVideoPlay->PlayFromFile(Fname);
m_prog.SetRange(0,(int)pVideoPlay->tLength);
m_prog.ShowWindow(SW_SHOW);
m_TPlayFile=TRUE;
SetTimer(106,1000,NULL);
}
void CSpernView::OnFileOpen()
{
// TOD Add your command handler code here
CString FTemp;
CFileDialog dlg(TRUE,NULL,NULL,NULL,"AVI文件(*.avi)|*.avi|mpeg文件(*.mpg)");
dlg.m_ofn.lpstrTitle="打开多媒体文件";
//dlg.m_ofn.lpstrInitialDir="c:\\Windows\\Temp";
CMainFrame* pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd;
if(dlg.DoModal()==IDOK)
{
Fname=dlg.GetPathName();
FTemp.Format("播放:%s",Fname);
pFrame->m_wndStatusBar.SetPaneText(0,"停止");
pFrame->m_wndStatusBar.SetPaneText(1,FTemp);
}
}
请教:我用directshow来播放视频文件(avi文件),碰到了内存不能读的错误!
我在vc中用directshow来播放视频文件(avi文件),碰到了内存不能读的错误!