Article ID: 167697
Article Last Modified on 11/21/2006
if (m_pUIActiveInfo != NULL)
{
ASSERT(m_pUIActiveInfo->m_hSharedMenu != NULL);
return TRUE;
}
m_pUIActiveInfo->m_hSharedMenu will always be NULL because you are not
doing menu merging. m_pUIActiveInfo is set to NULL when the control is UI
de-activated. In this case, the control is inplace activated when you first
click on it, so COleControl::OnActivateInPlace() is called. This, in turn,
calls BuildSharedMenu(). When BuildSharedMenu() returns, but before
OnActivateInPlace() is exited, Internet Explorer calls
DoVerb(OLEIVERB_UIACTIVATE) on the control. This causes OnActivateInPlace()
to be re-entered and BuildSharedMenu() to be called again. Because the
control has not been UI-de-activated, m_pUIActiveInfo is not NULL.
HRESULT CTestCtrl::OnActivateInPlace(BOOL bUIActivate, LPMSG pMsg)
{
static BOOL bInsideFunc = FALSE;
if (!bInsideFunc)
{
bInsideFunc = TRUE;
HRESULT hr = COleControl::OnActivateInPlace(bUIActivate, pMsg);
bInsideFunc = FALSE;
return hr;
}
return S_OK;
}
Keywords: kberrmsg kbbug kbfix kbnoupdate kbvc600fix kbctrlcreate kbctrl KB167697