首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

_WMPOCXEvents IWMPEvents 网页中的active

2012-02-15 
_WMPOCXEvents IWMPEvents 网页中的active在线等CComPtr IWMPCorem_spWMPPlayerhrspElemDisp.QueryInt

_WMPOCXEvents IWMPEvents 网页中的active 在线等
CComPtr <IWMPCore>   m_spWMPPlayer;
hr   =   spElemDisp.QueryInterface(&m_spWMPPlayer);
if   (m_spWMPPlayer!=NULL&&SUCCEEDED(hr))
{

CComPtr <IConnectionPointContainer>     spConnectionContainer;
CComPtr <IWMPEvents>                     spEventListener;
CComPtr <IConnectionPoint>       m_spConnectionPoint;  
DWORD       dwCookie;    
m_spWMPPlayer-> QueryInterface(&spConnectionContainer);
//   hr   =   m_spWMPPlayer-> QueryInterface(&spConnectionContainer);
if   (FAILED(hr))
{
MessageBox(0,0,0,0);
break;
}

hr   =   spConnectionContainer-> FindConnectionPoint(__uuidof(IWMPEvents),   &m_spConnectionPoint);
if   (FAILED(hr))
{
MessageBox(0, "0.1 ",0,0);//会出现

hr   =   spConnectionContainer-> FindConnectionPoint(__uuidof(_WMPOCXEvents),   &m_spConnectionPoint);
if   (FAILED(hr))
{
MessageBox(0, "1 ",0,0);//会出现   TMD2个都失败了
break;
}

}
hr   =   m_spConnectionPoint-> Advise(spEventListener,   &dwCookie);
if   (FAILED(hr))
{
MessageBox(0, "2 ",0,0);
break;
}


[解决办法]
WMSDK\WMPSDK9\samples\cpp\WMPHost这个例子与你的代码类似
[解决办法]
hr =E_NOINTERFACE
在哪里?

热点排行