各位好,求各位看个问题吧:
我建立了一个dlg 用来播放TcpMp
代码如下
初始化dlg:
C/C++ codeBOOL 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 screen
AfxMessageBox(_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
}
播放初始化:
C/C++ coderect DefaultRect = {0,0,320,240};//播放电影窗口区域
wchar_t URL[] = _T("\\USB Disk\\11.avi");//播放文件的路径
//初始化TCPMP
BOOL 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;
}
问题来了:
AfxMessageBox(_T("99 !"));
后会弹出“ERR_FFFFFFF3”
AfxMessageBox(_T("aa !"));
后会弹出“ERR_FFFFFFF3”
然后AfxMessageBox(_T("bb !"));
然后出现窗口,但是只是一个空窗口
我想知道那两个错误是怎么回事呢,是指针的问题么,但是源代码也是这么写的呢
百思不得其解啊
m_Player->Set(m_Player,PLAYER_LIST_CURRIDX,&index,sizeof(index));//设置播放列表里的某个文件为当前播放文件
AfxMessageBox(_T("aa !"));
报什么错误