Help please , i need to implement a static function in CView derived class that must return to CDoc derived class the active view pointer...how can i do?
i tried something similar
CSdicap10View* CSdicap10View::GetView()
{
CSdicap10View* pView = GetActiveView();
return pView;
}
it return error GetActiveView undeclared identifier
or also
CSdicap10View* CSdicap10View::GetView()
{
return this;
}
but it return static member functions don't have this pointer and also
CSdicap10View* CSdicap10View::GetView()
{
CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);
CView * pView = pFrame->GetActiveView();
if ( !pView )
return NULL;
if ( ! pView->IsKindOf( RUNTIME_CLASS(CSdicap10View) ) )
return NULL;
return (CSdicap10View*) pView;
}
it doesn't work gve error unhandled exception
how can i do?
Thanks a lot
i tried something similar
CSdicap10View* CSdicap10View::GetView()
{
CSdicap10View* pView = GetActiveView();
return pView;
}
it return error GetActiveView undeclared identifier
or also
CSdicap10View* CSdicap10View::GetView()
{
return this;
}
but it return static member functions don't have this pointer and also
CSdicap10View* CSdicap10View::GetView()
{
CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);
CView * pView = pFrame->GetActiveView();
if ( !pView )
return NULL;
if ( ! pView->IsKindOf( RUNTIME_CLASS(CSdicap10View) ) )
return NULL;
return (CSdicap10View*) pView;
}
it doesn't work gve error unhandled exception
how can i do?
Thanks a lot