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. CSplitterWnd with MDI Child Windows

CSplitterWnd with MDI Child Windows

Scheduled Pinned Locked Moved C / C++ / MFC
comhelptutorial
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.
  • U Offline
    U Offline
    User 13245912
    wrote on last edited by
    #1

    I create mdi application with splitter in MainFrame with two areas. In first area i suppose to a static control and MDI child windows in second. The CSplitterWnd is created, but i can`t create MDI child window in splitter panel. I have the following code in OnCreateClient function
    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
    {
    if (!m_mainSplitter.CreateStatic(this, 1, 2, WS_VISIBLE | WS_CHILD, AFX_IDW_PANE_FIRST))
    {
    //MessageBox( "Error setting up m_mainSplitter", "ERROR", MB_OK | MB_ICONERROR );
    return FALSE;
    }
    if (!m_mainSplitter.CreateView(0, 0, RUNTIME_CLASS(CMDIAppView),
    CSize(140, cr.Height()), pContext))
    {
    //MessageBox( "Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR );
    return FALSE;
    }

    if (!m\_mainSplitter.CreateView(0, 1, RUNTIME\_CLASS(CMDIAppView),
    	CSize(cr.Width()-140, cr.Height()), pContext))
    {
    	//MessageBox( "Error setting up splitter view", "ERROR", MB\_OK | MB\_ICONERROR );
    	return FALSE;
    }
    m\_bInitSplitter = true;
    
    return CreateClient(lpcs, NULL);
    

    }

    I try to change CChildFrame::OnCreate
    with CWnd* pView = GetDlgItem(AFX_IDW_PANE_FIRST);
    cs.hwndParent = pView->m_hWnd;
    but i have a error. I think that CMDIAppView is corresponded to CMDiChild view area in MDI application and conflicted with created splitter, i tryed to create splitterview in another class but still unsuccessful.
    I found article "SDI Application with MDI Child Windows in Static Splitter Pane" by John Z. Czopowik in codeguru but can not download source code from there. Please can anyone explane me how to create mdi child windows in splitter panel.
    Mikle G.
    email: mg17110081@gmail.com

    D 1 Reply Last reply
    0
    • U User 13245912

      I create mdi application with splitter in MainFrame with two areas. In first area i suppose to a static control and MDI child windows in second. The CSplitterWnd is created, but i can`t create MDI child window in splitter panel. I have the following code in OnCreateClient function
      BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
      {
      if (!m_mainSplitter.CreateStatic(this, 1, 2, WS_VISIBLE | WS_CHILD, AFX_IDW_PANE_FIRST))
      {
      //MessageBox( "Error setting up m_mainSplitter", "ERROR", MB_OK | MB_ICONERROR );
      return FALSE;
      }
      if (!m_mainSplitter.CreateView(0, 0, RUNTIME_CLASS(CMDIAppView),
      CSize(140, cr.Height()), pContext))
      {
      //MessageBox( "Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR );
      return FALSE;
      }

      if (!m\_mainSplitter.CreateView(0, 1, RUNTIME\_CLASS(CMDIAppView),
      	CSize(cr.Width()-140, cr.Height()), pContext))
      {
      	//MessageBox( "Error setting up splitter view", "ERROR", MB\_OK | MB\_ICONERROR );
      	return FALSE;
      }
      m\_bInitSplitter = true;
      
      return CreateClient(lpcs, NULL);
      

      }

      I try to change CChildFrame::OnCreate
      with CWnd* pView = GetDlgItem(AFX_IDW_PANE_FIRST);
      cs.hwndParent = pView->m_hWnd;
      but i have a error. I think that CMDIAppView is corresponded to CMDiChild view area in MDI application and conflicted with created splitter, i tryed to create splitterview in another class but still unsuccessful.
      I found article "SDI Application with MDI Child Windows in Static Splitter Pane" by John Z. Czopowik in codeguru but can not download source code from there. Please can anyone explane me how to create mdi child windows in splitter panel.
      Mikle G.
      email: mg17110081@gmail.com

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Member 13277911 wrote:

      ...but i have a error.

      What error?

      Member 13277911 wrote:

      ...but can not download source code from there.

      Why not? Can you get it from here instead?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      U 2 Replies Last reply
      0
      • D David Crow

        Member 13277911 wrote:

        ...but i have a error.

        What error?

        Member 13277911 wrote:

        ...but can not download source code from there.

        Why not? Can you get it from here instead?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        U Offline
        U Offline
        User 13245912
        wrote on last edited by
        #3

        in codeguru SDI Application with MDI Child Windows in Static Splitter Pane i don't have permission to access on this server. The error is First-chance exception at 0x00D91166 in MDIAppView.exe: 0xC0000005: Access violation reading location 0x00000020. if i add cs.hwndParent = pView->m_hWnd; to CChildFrame::PreCreateWindow this error while MFC window creation i think. may be subclass the child window can resolve this problem but i dont know how to subclass MDIChild with panel. i know that WTL can place mdichild window in CSplitterWnd The suppose is to create MFC mdichild window with CSplitterWnd as parent in MFC program.

        1 Reply Last reply
        0
        • D David Crow

          Member 13277911 wrote:

          ...but i have a error.

          What error?

          Member 13277911 wrote:

          ...but can not download source code from there.

          Why not? Can you get it from here instead?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          U Offline
          U Offline
          User 13245912
          wrote on last edited by
          #4

          Thanks for program. I think it helps in solution.

          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