Google

Code snippet to access view class from main frame in SDI Apps VC++

CFrameWnd *pFrame = static_cast (AfxGetMainWnd());
CMyView *pView = static_cast (pFrame->GetActiveView());
ASSERT(pView != NULL); // SDI should have one