关于TcpMp在指定窗口播放的问题
各位好,求各位看个问题吧:
我建立了一个dlg 用来播放TcpMp
代码如下
初始化dlg:
BOOL ClsqTcpmpDlg::OnInitDialog(){ CDialog::OnInitDialog();AfxMessageBox(_T("11!")); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon AfxMessageBox(_T("22!")); CenterWindow(GetDesktopWindow()); // center to the hpc screenAfxMessageBox(_T("33!")); // TODO: Add extra initialization here g_pPlayerWnd = this;AfxMessageBox(_T("444 !")); InitTcpmp();AfxMessageBox(_T("55!")); return TRUE; // return TRUE unless you set the focus to a control}
rect DefaultRect = {0,0,320,240};//播放电影窗口区域wchar_t URL[] = _T("\\USB Disk\\11.avi");//播放文件的路径//初始化TCPMPBOOL ClsqTcpmpDlg::InitTcpmp(){ //初始化 if(Context_Init(_T("TCPMP"),_T("0.72RC1"),3,(wchar_t*)AfxGetApp()->m_lpCmdLine,NULL))// { AfxMessageBox(_T("66 !")); context* pContext=Context();//获得上下文 if(pContext) m_Player=(player*)(pContext->Player); else return false; Context_Wnd(this->GetSafeHwnd());//播放窗口关联 //设置通知处理函数 Notify.Func = (notifyfunc)PlayerNotify; Notify.This = (void*)m_Player; if(m_Player) m_Player->Set(m_Player,PLAYER_NOTIFY,&Notify,sizeof(Notify)); AfxMessageBox(_T("77 !")); int i = 0; m_Player->Set(m_Player,PLAYER_LIST_COUNT,&i,sizeof(int));//播放列表清空 m_Player->Set(m_Player,PLAYER_LIST_URL+0,URL,sizeof(URL));AfxMessageBox(_T("88 !")); m_Player->Set(m_Player,PLAYER_SKIN_VIEWPORT,&DefaultRect,sizeof(rect));//设置播放电影窗口区域 AfxMessageBox(_T("99 !")); int index = 0; m_Player->Set(m_Player,PLAYER_LIST_CURRIDX,&index,sizeof(index));//设置播放列表里的某个文件为当前播放文件AfxMessageBox(_T("aa !")); m_Player->Set(m_Player,PLAYER_PLAY,&m_bPlayOrPaulse,sizeof(BOOL));//开始播放AfxMessageBox(_T("bb!")); } else return false; return true;}