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. Is it possible to split CView window with CSpliterWnd just like frame window?

Is it possible to split CView window with CSpliterWnd just like frame window?

Scheduled Pinned Locked Moved C / C++ / MFC
question
1 Posts 1 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.
  • R Offline
    R Offline
    rambojanggoon
    wrote on last edited by
    #1

    Hi,

    Is it possible to split view windows like frame frame window with CSplitterWnd?

    class CMyWnd : public CView
    {
    protected:
    DECLARE_DYNCREATE(CMyWnd)

    public:
    CMyWnd();
    virtual ~CMyWnd();
    CSplitterWnd m_sp;
    };

    BOOL CMyWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
    {

    m_sp.Create(this, 1,2, CSize(10, 10),
    pContext);

     //CAView is subclass of CView.
    

    if(!m_sp.CreateView(0, 0,RUNTIME_CLASS(CAview), CSize( 100, 300), pContext))return FALSE;

    //CCview is subclass of CView.
    

    if(!m_sp.CreateView(0, 1,RUNTIME_CLASS(CCview), CSize(400, 300), pContext))return FALSE;
    return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
    }

    After doing above, to make window I did as followings.
    program die...
    Is it possible to split CView window with SplitterWnd?

    CMyWnd *p = new CMyWnd;
    p->Create(NULL, NULL, WS_CHILDWINDOW | WS_CLIPSIBLINGS | WS_OVERLAPPED | WS_VISIBLE|WS_BORDER,
    CRect (10,80, 1280,1024), this, 100, NULL);

    p->ShowWindow(SW_SHOW);

    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