为什么在DLL中创建MediaPlayer ActiveX对象有GetParent()断言失败? ( 积分: 50 )

  • 主题发起人 主题发起人 hongsen
  • 开始时间 开始时间
H

hongsen

Unregistered / Unconfirmed
GUEST, unregistred user!
为什么在DLL中创建MediaPlayer ActiveX对象有GetParent()断言失败?
死在CWnd::InitControlContainer()中了,
BOOL CWnd::InitControlContainer()
{
TRY
{
if (m_pCtrlCont == NULL)
m_pCtrlCont = afxOccManager->CreateContainer(this);
}
END_TRY
// Mark all ancestor windows as containing OLE controls.
if (m_pCtrlCont != NULL)
{
CWnd* pWnd = this;
while ((pWnd != NULL) &&
!(pWnd->m_nFlags &
WF_OLECTLCONTAINER))
{
pWnd->m_nFlags |= WF_OLECTLCONTAINER;
pWnd = pWnd->GetParent();
if (! (GetWindowLong(pWnd->GetSafeHwnd(), GWL_STYLE) &
WS_CHILD))
break;
}
}
return (m_pCtrlCont != NULL);
}
 
为什么在DLL中创建MediaPlayer ActiveX对象有GetParent()断言失败?
死在CWnd::InitControlContainer()中了,
BOOL CWnd::InitControlContainer()
{
TRY
{
if (m_pCtrlCont == NULL)
m_pCtrlCont = afxOccManager->CreateContainer(this);
}
END_TRY
// Mark all ancestor windows as containing OLE controls.
if (m_pCtrlCont != NULL)
{
CWnd* pWnd = this;
while ((pWnd != NULL) &&
!(pWnd->m_nFlags &
WF_OLECTLCONTAINER))
{
pWnd->m_nFlags |= WF_OLECTLCONTAINER;
pWnd = pWnd->GetParent();
if (! (GetWindowLong(pWnd->GetSafeHwnd(), GWL_STYLE) &
WS_CHILD))
break;
}
}
return (m_pCtrlCont != NULL);
}
 
后退
顶部