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. problems with... MDI and Splitter::CreateView.

problems with... MDI and Splitter::CreateView.

Scheduled Pinned Locked Moved C / C++ / MFC
c++
3 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.
  • D Offline
    D Offline
    DerekSaw
    wrote on last edited by
    #1

    Previously, the app is SDI... but the I want to change it to MDI. So, CMainFrame (before derived from CFrameWnd) is derived from CMDIFrameWnd. But somehow rather, problems happen in here, the CreateView under OnCreateClient().... Anyone know the DO's and DON'Ts I need to know when converting from SDI to MDI.... // MainFrame.cpp .... BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { ... // Add the filter view if (!m_wndSplitterTop.CreateView(0, 0, RUNTIME_CLASS(CFilterView), CSize(cxUpper, 0), pContext)) ... } ...

    S 1 Reply Last reply
    0
    • D DerekSaw

      Previously, the app is SDI... but the I want to change it to MDI. So, CMainFrame (before derived from CFrameWnd) is derived from CMDIFrameWnd. But somehow rather, problems happen in here, the CreateView under OnCreateClient().... Anyone know the DO's and DON'Ts I need to know when converting from SDI to MDI.... // MainFrame.cpp .... BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { ... // Add the filter view if (!m_wndSplitterTop.CreateView(0, 0, RUNTIME_CLASS(CFilterView), CSize(cxUpper, 0), pContext)) ... } ...

      S Offline
      S Offline
      Stephen C Steel
      wrote on last edited by
      #2

      If you converting an SDI app where the view was split (two views onto the one document), you'd normally map that to an MDI application where each document frame (CMDIChildWnd) is split into two views. So, you don't want to modify your CMainFrame class (now derived from CMDIFrameWnd), you want to derived a class from CMDIChildWnd, add a splitter and override its virtual OnCreateClientClient() call. Then modify the CMultiDocTemplate created in the applications InitInstance() function to use your derived class rather than CMDIChildWnd. Stephen C. Steel Kerr Vayne Systems Ltd.

      D 1 Reply Last reply
      0
      • S Stephen C Steel

        If you converting an SDI app where the view was split (two views onto the one document), you'd normally map that to an MDI application where each document frame (CMDIChildWnd) is split into two views. So, you don't want to modify your CMainFrame class (now derived from CMDIFrameWnd), you want to derived a class from CMDIChildWnd, add a splitter and override its virtual OnCreateClientClient() call. Then modify the CMultiDocTemplate created in the applications InitInstance() function to use your derived class rather than CMDIChildWnd. Stephen C. Steel Kerr Vayne Systems Ltd.

        D Offline
        D Offline
        DerekSaw
        wrote on last edited by
        #3

        :) Thanx 4 the help. Can I create splitter window (and its view) on CMDIFrameWnd? I was thinking of doing something like VC++ where the Workspace is on the left of the splitter, and Output below another splitter, leaving the space left for ChildWnd. Any clue on these??

        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