先在CConferenceView类中接收数据,并向CMainFrame类发送消息事件
msg.Serialize (*m_pArchiveIn);
AfxGetMainWnd()->SendMessage(WM_ADDLIST+2, (LPARAM)&(msg.ip), 6);
CMainFrame类中响应事件相关代码如下:
[code=C/C++]void CMainFrame::OnAddIp(WPARAM wParam, LPARAM lParam)
{
CString* pStr = (CString*)wParam;
char sCall[20];
Call(sCall,PORT,1);
pStr->ReleaseBuffer();
}
上面这样调用Call方法怎么显示不了视频数据呢?我直接这样写Call("127.0.0.1",PORT,1)是可以显示视频图像的。请高手指点,谢谢!!

解决方案 »

  1.   

    Call方法是这样定义的:
    BOOL CMainFrame::Call(char *ip, unsigned short port,int flag)
    {
    BOOL bRet=FALSE;
    CString strIP,ssIP;
    ssIP=(LPCSTR)ip;
    POSITION pos;
    if (m_ClientInfoList.GetCount()!=0)
    {
    for( pos = m_ClientInfoList.GetHeadPosition(); pos != NULL; )
    {
    CClientInfo *pClientInfo=m_ClientInfoList.GetAt(pos);
    strIP.Format("%d.%d.%d.%d",
    pClientInfo->m_Cmddst.sin_addr.S_un.S_un_b.s_b1,
    pClientInfo->m_Cmddst.sin_addr.S_un.S_un_b.s_b2,
    pClientInfo->m_Cmddst.sin_addr.S_un.S_un_b.s_b3,
    pClientInfo->m_Cmddst.sin_addr.S_un.S_un_b.s_b4);
    if (strIP==ssIP)
    {
    AfxMessageBox(strIP+" have been joined in!");
    if (pClientInfo!=NULL)
    {
    pClientInfo=NULL;
    delete pClientInfo;
    }
    return FALSE;

    }
    m_ClientInfoList.GetNext(pos);
    }// end of for                                                
    } SetCmdDst(ip,port);
    SetAVDst(ip,port+1);
    PACK_CMD pc;
    pc.flag=FLAG_CMD;
    for (int i=0;i<MAX_CONNECT_USER;i++)
    {
    if (ssIP==sIP[i])
    {
    pc.m_ChatNo=m_ChatNo[i];
    }
    }
    pc.cmd=CMD_JOIN;
    pc.type=0;
    pc.data_size_extra=0;
    pc.ext=VER_TVMEETING&0xff;
    char sz[50];
    m_sockaddr=GetCurrentAddr();
    sprintf(sz,"%d.%d.%d.%d",
    m_sockaddr.sin_addr.S_un.S_un_b.s_b1,
    m_sockaddr.sin_addr.S_un.S_un_b.s_b2,
    m_sockaddr.sin_addr.S_un.S_un_b.s_b3,
    m_sockaddr.sin_addr.S_un.S_un_b.s_b4);
    if(!SendCmd(&pc,sizeof(pc),m_Cmddst,TRUE))
    {
    return FALSE;
    }
    bRet=TRUE;
    return bRet;
    }
      

  2.   

    这样显示看看行不行?
    void CMainFrame::OnAddIp(WPARAM wParam, LPARAM lParam)
    {
    CString* pStr = (CString*)wParam;
    char sCall[20];
    strcpy(sCall,pStr.GetBuffer(pStr.GetLength()));
    Call(sCall,PORT,1);
    pStr->ReleaseBuffer();}