CWMPControls m_control;
COcx1 m_avPlayer;
问题:
this->m_control=static_cast<CWMPControls>(this->m_avPlayer.get_controls());
this->m_control.pause();
报错:错误 1 error C2440: 'static_cast' : cannot convert from 'LPDISPATCH' to 'CWMPControls' f:\hq\aviplayer\aviplayer\aviplayerdlg.cpp 170
m_control.AttachDispatch(m_avPlayer.get_controls());
m_control.AttachDispatch(m_avPlayer.get_有问题啊,class CWMPControls : public CWnd
m_control是CWMPControls 的对象,
可是AttachDispatch是COleDispatchDriver类的方法啊,
ontrols());
我的VC++ 2010生成的类是这样的
class CWMPControls : public COleDispatchDriver
{
public:
CWMPControls() {} // Calls COleDispatchDriver default constructor
CWMPControls(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
CWMPControls(const CWMPControls& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}