高手请进------》view in dialog
本人把scrollView加到了对话框中,如果是基于对话框的程序,view击活正常
在popUP窗口中出错。何为?
产生错误的地方为:
int CView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
int nResult = CWnd::OnMouseActivate(pDesktopWnd, nHitTest, message);
if (nResult == MA_NOACTIVATE || nResult == MA_NOACTIVATEANDEAT)
return nResult; // frame does not want to activate
CFrameWnd* pParentFrame = GetParentFrame();
if (pParentFrame != NULL)//第一中情况为FALSE,第二中情况为TRUE
{
// eat it if this will cause activation
ASSERT(pParentFrame == pDesktopWnd || pDesktopWnd->IsChild(pParentFrame));
// either re-activate the current view, or set this view to be active
CView* pView = pParentFrame->GetActiveView();
HWND hWndFocus = ::GetFocus();
if (pView == this &&
m_hWnd != hWndFocus && !::IsChild(m_hWnd, hWndFocus))
{
// re-activate this view
OnActivateView(TRUE, this, this);
}
else
{
// activate this view
pParentFrame->SetActiveView(this);
}
}
return nResult;
}