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. Can I create split windows dynamically?

Can I create split windows dynamically?

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingquestion
2 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.
  • B Offline
    B Offline
    bilas
    wrote on last edited by
    #1

    Good time of day! :) Please, help me to solve my little problem I created split window with two views. BOOL CMainFrame::CreateSplitters(int nRows, int nCols, int m_actRow, int m_actCol, CCreateContext* pContext) { m_bInitSplitter = FALSE; my_RightView = RUNTIME_CLASS( CRightHTMLView ); my_LeftView = RUNTIME_CLASS( CMyTree ); CRect cr; GetClientRect( &cr); /* Than I create two split windows using m_wndSplitter.Create( this, 1, 2, CSize(0,0), pContext ); */ .. //In next line I have "Debug Assertion Failed". if ( !m_wndSplitter.CreateView( 0, 0, my_LeftView, CSize(width/5, cr.Height()), pContext ) || !m_wndSplitter.CreateView( /*0, 1,*/m_actRow, m_actCol, my_RightView, CSize(4*width/5, cr.Height(), pContext )) { ... } //But when I create static split window, it works good. ... } But I need two create split window dynamically, 'cos later I'll need to destroy it and create another two views (but with gorizontal locating) Please, help me.

    B 1 Reply Last reply
    0
    • B bilas

      Good time of day! :) Please, help me to solve my little problem I created split window with two views. BOOL CMainFrame::CreateSplitters(int nRows, int nCols, int m_actRow, int m_actCol, CCreateContext* pContext) { m_bInitSplitter = FALSE; my_RightView = RUNTIME_CLASS( CRightHTMLView ); my_LeftView = RUNTIME_CLASS( CMyTree ); CRect cr; GetClientRect( &cr); /* Than I create two split windows using m_wndSplitter.Create( this, 1, 2, CSize(0,0), pContext ); */ .. //In next line I have "Debug Assertion Failed". if ( !m_wndSplitter.CreateView( 0, 0, my_LeftView, CSize(width/5, cr.Height()), pContext ) || !m_wndSplitter.CreateView( /*0, 1,*/m_actRow, m_actCol, my_RightView, CSize(4*width/5, cr.Height(), pContext )) { ... } //But when I create static split window, it works good. ... } But I need two create split window dynamically, 'cos later I'll need to destroy it and create another two views (but with gorizontal locating) Please, help me.

      B Offline
      B Offline
      Bob Ciora
      wrote on last edited by
      #2

      Why not try splitting the OR into two statements? You may be assuming a boolean short-circuit that isn't occurring. So it's calling CreateView twice, not once. Bob Ciora

      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