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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. splitting view

splitting view

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
7 Posts 2 Posters 2 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.
  • W Offline
    W Offline
    wong1907
    wrote on last edited by
    #1

    I want to ask how to display four view at the same time(i.e. splitting), each views are come from different class?? (e.g view1, view2 view 3, view4) :):-D

    W 1 Reply Last reply
    0
    • W wong1907

      I want to ask how to display four view at the same time(i.e. splitting), each views are come from different class?? (e.g view1, view2 view 3, view4) :):-D

      W Offline
      W Offline
      Weiye Chen
      wrote on last edited by
      #2

      You want to display in 2x2 or 4x1 or 1x4?? Weiye, Chen When pursuing your dreams, don't forget to enjoy your life...

      W 1 Reply Last reply
      0
      • W Weiye Chen

        You want to display in 2x2 or 4x1 or 1x4?? Weiye, Chen When pursuing your dreams, don't forget to enjoy your life...

        W Offline
        W Offline
        wong1907
        wrote on last edited by
        #3

        i WANT TO DISPLAY 2X2 THX!!!

        W 1 Reply Last reply
        0
        • W wong1907

          i WANT TO DISPLAY 2X2 THX!!!

          W Offline
          W Offline
          Weiye Chen
          wrote on last edited by
          #4

          Then you can try this BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext) { // Create splitter window for 2 rows, 2 cols, abort if failed if (m_wndSplitter.CreateStatic(this, 2, 2) == FALSE) return FALSE; // Create each view for each pane, abort if failed if (m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView1), CSize(100, 100), pContext) == FALSE || m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CView2), CSize(100, 100), pContext) == FALSE || m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CView3), CSize(100, 100), pContext) == FALSE || m_wndSplitter.CreateView(1, 1, RUNTIME_CLASS(CView4), CSize(100, 100), pContext) == FALSE) return FALSE; // Splitter window and views created successfully return TRUE; } Weiye, Chen When pursuing your dreams, don't forget to enjoy your life...

          W 1 Reply Last reply
          0
          • W Weiye Chen

            Then you can try this BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext) { // Create splitter window for 2 rows, 2 cols, abort if failed if (m_wndSplitter.CreateStatic(this, 2, 2) == FALSE) return FALSE; // Create each view for each pane, abort if failed if (m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView1), CSize(100, 100), pContext) == FALSE || m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CView2), CSize(100, 100), pContext) == FALSE || m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CView3), CSize(100, 100), pContext) == FALSE || m_wndSplitter.CreateView(1, 1, RUNTIME_CLASS(CView4), CSize(100, 100), pContext) == FALSE) return FALSE; // Splitter window and views created successfully return TRUE; } Weiye, Chen When pursuing your dreams, don't forget to enjoy your life...

            W Offline
            W Offline
            wong1907
            wrote on last edited by
            #5

            Thx you very much!!! But when I execute it it tell me CView1 is not a class or namespace name classCView1: undeclared identifier CView2 is not a class or namespace name classCView2: undeclared identifier CView3 is not a class or namespace name classCView3: undeclared identifier CView4 is not a class or namespace name classCView4: undeclared identifier How can I solve it? Sorry for I have many question!!!

            W 1 Reply Last reply
            0
            • W wong1907

              Thx you very much!!! But when I execute it it tell me CView1 is not a class or namespace name classCView1: undeclared identifier CView2 is not a class or namespace name classCView2: undeclared identifier CView3 is not a class or namespace name classCView3: undeclared identifier CView4 is not a class or namespace name classCView4: undeclared identifier How can I solve it? Sorry for I have many question!!!

              W Offline
              W Offline
              Weiye Chen
              wrote on last edited by
              #6

              CView1, CView2, ... CView4 are your 4 different views that you need to create. You need to replace them with the actual names of those view classes you created. Weiye, Chen When pursuing your dreams, don't forget to enjoy your life...

              W 1 Reply Last reply
              0
              • W Weiye Chen

                CView1, CView2, ... CView4 are your 4 different views that you need to create. You need to replace them with the actual names of those view classes you created. Weiye, Chen When pursuing your dreams, don't forget to enjoy your life...

                W Offline
                W Offline
                wong1907
                wrote on last edited by
                #7

                OK Thx you very much!!! I know how to do it right now^V^

                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