'CWnd::GetParentFrame' : illegal call of non-static member function
Posted on 2004-08-21
I'm creating Frame and View at Run Time, and I have static method where I'm trying to get pointer to my Mainframe
CMyView * CMyView::GetView()
CMainFrame* pFrame = (CMainFrame*)GetParentFrame(); //here I got an error (error C2352: 'CWnd::GetParentFrame' : illegal call of non-static member function)
CMyView *pView = (CMyView *)pFrame->m_pSplitterWnd->GetPane(0,0);
return (CMyView *) pView;
static CMyView * GetView();
But I got an error "illegal call of non-static member function" .
Please help me how can I get a pointer to my Frame inside(or outside) of this method??