Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Seprating client area in MDI application.

Seprating client area in MDI application.

Scheduled Pinned Locked Moved C / C++ / MFC
wpfquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mostafa_pasha
    wrote on last edited by
    #1

    how seprate client area of application from frame window in MDI? is way is correct sepreate CChildFrame ??? alternative way i hear is : create window with WS_OVERLAPPED! but when i try this: BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { cs.style |= WS_OVERLAPPED; if( !CMDIFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return TRUE; } there is nothing happen. Best Regards. MJM

    J 1 Reply Last reply
    0
    • M mostafa_pasha

      how seprate client area of application from frame window in MDI? is way is correct sepreate CChildFrame ??? alternative way i hear is : create window with WS_OVERLAPPED! but when i try this: BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { cs.style |= WS_OVERLAPPED; if( !CMDIFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return TRUE; } there is nothing happen. Best Regards. MJM

      J Offline
      J Offline
      Jun Du
      wrote on last edited by
      #2

      mostafa_pasha wrote:

      seprate client area of application from frame window in MDI?

      Please be more specific on what you want to do.

      Best, Jun

      M 1 Reply Last reply
      0
      • J Jun Du

        mostafa_pasha wrote:

        seprate client area of application from frame window in MDI?

        Please be more specific on what you want to do.

        Best, Jun

        M Offline
        M Offline
        mostafa_pasha
        wrote on last edited by
        #3

        my project is MDI ! i have two view class , CStartPageView and CImageProcessingView ! first application execute OnDraw of CStartPageView because i create document when OnFileNew fucntion run i create some object as CImagePorcessingView.when create new page something that i use in CStartPageView::OnDraw show in client area of CImageProcessingView. i mean every thing i draw in page has affect in another page!although the client area (to view class) is seperable. // in CWinApp::InitInstance // i create to document template : m_pDocTemplate = new CMultiDocTemplate( IDR_ImageProcessingTYPE, RUNTIME_CLASS(CImageProcessingDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CImageProcessingView)); if (!m_pDocTemplate) return FALSE; AddDocTemplate(m_pDocTemplate); m_pDocTemplateStartPage = new CMultiDocTemplate( IDR_ImageProcessingTYPE, RUNTIME_CLASS(CImageProcessingDoc), RUNTIME_CLASS(CChildFrame), RUNTIME_CLASS(CStartPageView)); if (!m_pDocTemplateStartPage) return FALSE; AddDocTemplate(m_pDocTemplateStartPage); in OnFileNew: //create document that class view is CStartPageView CDocument* pDoc = m_pDocTemplateStartPage->OpenDocumentFile(NULL); // & for CImageProcessingView is pDocTemplate->OpenDocument(BULL);

        J 1 Reply Last reply
        0
        • M mostafa_pasha

          my project is MDI ! i have two view class , CStartPageView and CImageProcessingView ! first application execute OnDraw of CStartPageView because i create document when OnFileNew fucntion run i create some object as CImagePorcessingView.when create new page something that i use in CStartPageView::OnDraw show in client area of CImageProcessingView. i mean every thing i draw in page has affect in another page!although the client area (to view class) is seperable. // in CWinApp::InitInstance // i create to document template : m_pDocTemplate = new CMultiDocTemplate( IDR_ImageProcessingTYPE, RUNTIME_CLASS(CImageProcessingDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CImageProcessingView)); if (!m_pDocTemplate) return FALSE; AddDocTemplate(m_pDocTemplate); m_pDocTemplateStartPage = new CMultiDocTemplate( IDR_ImageProcessingTYPE, RUNTIME_CLASS(CImageProcessingDoc), RUNTIME_CLASS(CChildFrame), RUNTIME_CLASS(CStartPageView)); if (!m_pDocTemplateStartPage) return FALSE; AddDocTemplate(m_pDocTemplateStartPage); in OnFileNew: //create document that class view is CStartPageView CDocument* pDoc = m_pDocTemplateStartPage->OpenDocumentFile(NULL); // & for CImageProcessingView is pDocTemplate->OpenDocument(BULL);

          J Offline
          J Offline
          Jun Du
          wrote on last edited by
          #4

          mostafa_pasha wrote:

          in OnFileNew: //create document that class view is CStartPageView CDocument* pDoc = m_pDocTemplateStartPage->OpenDocumentFile(NULL); // & for CImageProcessingView is pDocTemplate->OpenDocument(BULL);

          There are problems in your code. Try this in OnFileNew():

          CImageProcessingDoc* pDoc = (CImageProcessingDoc*)m_pDocTemplate->OpenDocumentFile(NULL);

          CFrameWnd* pNewFrame = m_pDocTemplateStartPage->CreateNewFrame(pDoc, NULL);
          if (pNewFrame != NULL)
          {
          m_pDocTemplateStartPage->InitialUpdateFrame(pNewFrame, pDoc);
          }

          Best, Jun

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups