Is it normal to have to update assertions after upgrading the compiler from VC++ 6 to MSVC 2005? I have the following function which works without triggering the assertion in Visual Studio 6 but anything newer it fails.
void CMainFrame::OnUpdateGraphValue (CCmdUI* pCmdUI) {
BOOL bMax;
CMDIChildWnd *child = MDIGetActive (&bMax);
if (child)
{
if (child->IsKindOf (RUNTIME_CLASS (CGaugeChildFrame)))
{
CGaugeView *pView = (CGaugeView *) child->GetActiveView ();
if (pView->wndActive)
{
ASSERT (pView->IsKindOf (RUNTIME_CLASS (CGaugeView)));
pCmdUI->Enable (TRUE);
return;
}
}
if (child->IsKindOf (RUNTIME_CLASS (CGarterChildFrame)))
{
CGarterView *pView = (CGarterView *) child->GetActiveView ();
if (pView->wndGraphics)
{
ASSERT (pView->IsKindOf (RUNTIME_CLASS (CGarterView)));
pCmdUI->Enable (TRUE);
return;
}
}
}
pCmdUI->Enable (FALSE); }
The failure occurs on line ASSERT (pView->IsKindOf (RUNTIME_CLASS (CGaugeView)));
When I click print preview the type is not CGaugeView
but CPreviewView
.
Can someone please shed some light on this for me? Thanks