// 定义
class CVodTextButtonIrr
{
public:
operator IVODWidget* () const;
private:
IVODButton* m_pBtnControl;
}
//实现
CVodTextButtonIrr::operator IVODWidget*() const
{
return m_pBtnControl;
}
//注: IVODButton 继承于IVODWidget
//下面有段代码有问题,为什么转换不起啊?
void* pCtrlPtr =
new CVodTextButtonIrr();
IVODWidget* pParentWidget = NULL;
pParentWidget = e_GetWidgetFromId((IVODWidget*)pCtrlPtr)->e_GetParentID());
|