I am creating MDI project using extended classes: CMDIFrameWndExCWinAppExCMDIChildWndExMy view class is derived from CScrollView.Code is working fine if I don't apply any style to Child window in PreCreateWindow. But when I apply style with visibility true then some debug assertion comes. On debugging further I came to know that asertion comes in below block while redrawing window.void
CMFCBaseTabCtrl::SetLocation(Location location)
{
ASSERT_VALID(this);
m_location = location;
RecalcLayout();
if (GetSafeHwnd() != NULL)
{
GetParent()->RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);
}
}
Another thing which I noticed is that when a child window is created with style WS_VISIBLE then Ondraw() of view class is called before OnInitialUpdate().
My code and logic was working fine without using extended classes so I don't want to change it as it would be a lot of re-work. So can anybody guide me what to do ?