BOOL CDuiActiveX::InitActiveX() { BOOL bRet=m_axContainer->CreateControl(m_rcWindow,m_clsid,m_clsCtx); if(bRet) { m_axContainer->ActivateAx(NULL); SetActiveXVisible(IsVisible(TRUE)); } OnInitActiveXFinished(); return bRet; }
void CDuiActiveX::OnShowWindow( BOOL bShow, UINT nStatus ) { __super::OnShowWindow(bShow, nStatus); if(bShow && m_bDelayInit) { InitActiveX();//窗口显示时才初始化 m_bDelayInit=FALSE; } SetActiveXVisible(bShow); }
void SActiveX::OnShowWindow( BOOL bShow, UINT nStatus ) { __super::OnShowWindow(bShow, nStatus); if(IsVisible(TRUE) && m_bDelayInit) { InitActiveX();//窗口显示时才初始化 m_bDelayInit=FALSE; } SetActiveXVisible(IsVisible(TRUE)); }
BOOL SActiveX::InitActiveX() { BOOL bRet=m_axContainer->CreateControl(m_clsid,m_clsCtx); if(bRet) { CRect rcClient; GetClientRect(&rcClient); m_axContainer->ActivateAx(NULL); SetActiveXVisible(IsVisible(TRUE)); m_axContainer->OnPosRectChange(rcClient); } OnInitActiveXFinished(); return bRet; }