CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
// Get the active MDI child window.
CMDIChildWnd *pChild = (CMDIChildWnd *)pFrame->GetActiveFrame();
// or CMDIChildWnd *pChild = pFrame->MDIGetActive();
// Get the active view attached to the active MDI child window.
CSerialDataView *pView = (CSerialDataView*)pChild->GetActiveView();
// Get the active MDI child window.
CMDIChildWnd *pChild = (CMDIChildWnd *)pFrame->GetActiveFrame();
// or CMDIChildWnd *pChild = pFrame->MDIGetActive();
// Get the active view attached to the active MDI child window.
CSerialDataView *pView = (CSerialDataView*)pChild->GetActiveView();