error C2039: 'Open' : is not a member of 'CWMPPlayer4'
        f:\049\wmpplayer4.h(30) : see declaration of 'CWMPPlayer4'
F:\049\049Dlg.cpp(196) : error C2039: 'Pause' : is not a member of 'CWMPPlayer4'
        f:\049\wmpplayer4.h(30) : see declaration of 'CWMPPlayer4'
F:\049\049Dlg.cpp(201) : error C2039: 'Play' : is not a member of 'CWMPPlayer4'
        f:\049\wmpplayer4.h(30) : see declaration of 'CWMPPlayer4'
F:\049\049Dlg.cpp(209) : error C2039: 'Stop' : is not a member of 'CWMPPlayer4'
        f:\049\wmpplayer4.h(30) : see declaration of 'CWMPPlayer4'添加了播放器控件,并为其添加了一个变量,但是这个控件的成员函数中为什么没有open(),pause()等函数呢?求解

解决方案 »

  1.   

    你能把CWMPPlayer4这个类给弄出来看看么
      

  2.   

    添加控件时,会添加wrapper类,看看暴露出来的方法
      

  3.   

    .h文件
    public:
    CWMPPlayer4 m_Player;     //播放地址关联   
    CWMPControls m_control;   //控制按钮关联   
        CWMPSettings m_setting;   //设置按钮关联   
        CWMPMedia m_media;         //媒体  
    .cpp文件
    BOOL CVideoPlayDlg::OnInitDialog()
    {
    CDialog::OnInitDialog(); // 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
    //  执行此操作
    CMenu menu;
    menu.LoadMenu(IDR_MENU1);
    SetMenu(&menu);
    menu.Detach(); m_Player.ModifyStyle(0,WS_CLIPCHILDREN);
    m_brush.CreateSolidBrush(RGB(0,0,0)); // TODO: 在此添加额外的初始化代码
    int tmp_W = GetSystemMetrics(SM_CXSCREEN);
    int tmp_H = GetSystemMetrics(SM_CYSCREEN);
    SetWindowPos(&CWnd::wndTopMost,-2,-2,tmp_W+8,tmp_H+8,SWP_SHOWWINDOW); if(m_Player)
    {
    CRect logoRect(0, 95, tmp_W+4,tmp_H-70);
    m_Player.MoveWindow(logoRect);
    } m_control=static_cast<CWMPControls>(m_Player.get_controls());   
    m_setting=m_Player.get_settings();  
    }
    void CVideoPlayDlg::OnOpen()
    {
    CString fileName;   
        CFileDialog fileDialog( TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,_T("音频、视频文件(*.*)|*.*||"),this);   
       if (fileDialog.DoModal() == IDOK)   
       {   
            fileName=fileDialog.GetPathName();   
           m_Player.put_URL(fileName);            //打开播放   
       }    
       m_media=static_cast<CWMPMedia>(m_Player.newMedia(fileName));  
       m_control.play();              //播放
    }void CVideoPlayDlg::OnPlay()
    {
    m_control.play();  //播放
    }void CVideoPlayDlg::OnPause()
    {

      m_control.pause();  //暂停
    }void CVideoPlayDlg::OnStop()
    {

    m_control.stop();        //停止 
    }void CVideoPlayDlg::OnForward()
    {

    m_control.fastForward();   //快进  
    }void CVideoPlayDlg::OnBack()
    {

     m_control.fastReverse();   //快退
    }void CVideoPlayDlg::OnRise()
    {

    m_setting.put_volume(m_setting.get_volume()+10);  //音量增加 
    }void CVideoPlayDlg::OnReduce()
    {

     m_setting.put_volume(m_setting.get_volume()-10);   //音量减少  
    }