void CMainFrame::OnFileNew(UINT uNotifyCode, int nID, CWindow wndCtl) { CChildFrame* pChild = new CChildFrame; pChild->CreateEx(m_hWndClient); // TODO: add code to initialize document }
void CMainFrame::OnFileOpen(UINT uNotifyCode, int nID, CWindow wndCtl) { CString strFilter = _T("ImageFile(*.bmp;*.jpg;*.jpeg;*.png)|*.bmp;*.jpg;*.jpeg;*.png|All Files(*.*)|*.*||"); strFilter.Replace(TEXT('|'), TEXT('\0')); CFileDialog dlgOpen(TRUE, NULL, NULL, OFN_PATHMUSTEXIST, strFilter, m_hWnd); if (dlgOpen.DoModal() == IDOK) { CChildFrame* pChild = new CChildFrame; pChild->CreateEx(m_hWndClient); pChild->SetImagePath(dlgOpen.m_szFileName); } }