CMDIChildWnd *pActiveChild=MDIGetActive();
CDocument *pDocument;
if(pActiveChild==NULL ||
(pDocument=pActiveChild->GetActiveDocument())==NULL)
{
TRACE("Warning: No active document for DirListView opened.\n");
AfxMessageBox(AFX_IDP_COMMAND_FAILURE);
return;
}
// Otherwise we have a new frame
CDocTemplate *pTemplate=((CxxxApp*)AfxGetApp())->m_pBugViewTemplate;
ASSERT_VALID(pTemplate);
CFrameWnd *pFrame=
pTemplate->CreateNewFrame(pDocument,pActiveChild);
if(pFrame==NULL)
{
TRACE("Warning: failed to create new frame.\n");
AfxMessageBox(AFX_IDP_COMMAND_FAILURE);
return;
}