在MFC程序中使用Windows Midea Player 9的控件,怎么控制它播放一个AVI文件?
WMP6.4时有Open、Play、Stop等函数
为什么WMP9版本没有这些函数?
请大侠们指点,谢谢!

解决方案 »

  1.   

    CWMPControls CWMPPlayer4::GetControls();
    CWMPControls::play();
    CWMPControls::stop();
      

  2.   

    TO: goodboyws(深夜不眠者)
    我主要是要播放AVI中的声音。
    你所说的CWMPControls类在哪个头文件里?我怎么找不到?
      

  3.   

    你是用添加ActiveX的么,为Windows Midea Player生成一个成员变量,系统会自动加一堆类在你的工程里,生成的成员变量就是CWMPPlayer4 m_xxx;
    CWMPControls在wmpcontrols.h里
    这是我自动生成的文件wmpplayer4.cpp#include "stdafx.h"
    #include "wmpplayer4.h"// Dispatch interfaces referenced by this interface
    #include "wmpcontrols.h"
    #include "WMPSettings.h"
    #include "wmpmedia.h"
    #include "wmpmediacollection.h"
    #include "wmpplaylistcollection.h"
    #include "wmpnetwork.h"
    #include "wmpplaylist.h"
    #include "wmpcdromcollection.h"
    #include "wmpclosedcaption.h"
    #include "WMPError.h"
    #include "wmpdvd.h"
    #include "WMPPlayerApplication.h"
    .....
    CWMPControls CWMPPlayer4::GetControls()
    {
    LPDISPATCH pDispatch;
    InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, NULL);
    return CWMPControls(pDispatch);
    }
    .....
      

  4.   

    TO: goodboyws(深夜不眠者)
    原来是在VC6中才会产生CWMPPlayer4
    在VC.NET中居然没有产生这些,真是奇怪
    不过CWMPControls中怎么没有Open之类的函数呢?那我怎么指定要播放哪个文件?
      

  5.   

    TO: goodboyws(深夜不眠者)
    我知道了,原来是CWMPPlayer4::SetURL代替了Open
    多谢.
    你知道为什么在VC.NET下在添加WMP的成员变量时,不会自动添加那些类吗?