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. ATL / WTL / STL
  4. how to change view in a sdi frame window

how to change view in a sdi frame window

Scheduled Pinned Locked Moved ATL / WTL / STL
questiontutorial
3 Posts 3 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.
  • F Offline
    F Offline
    fftz
    wrote on last edited by
    #1

    I need to show more than two views in a sdi frame window. My code like this: RECT rc; GetClientRect(&rc); m_hWndClient = m_view.Create(m_hWnd,rc); m_view.ShowWindow(SW_SHOW); m_view.SetFocus(); m_view2.ShowWindow(SW_HIDE); It can show m_view2,but not like default view. How can I switch views correctly?? opening view with wild mind

    T M 2 Replies Last reply
    0
    • F fftz

      I need to show more than two views in a sdi frame window. My code like this: RECT rc; GetClientRect(&rc); m_hWndClient = m_view.Create(m_hWnd,rc); m_view.ShowWindow(SW_SHOW); m_view.SetFocus(); m_view2.ShowWindow(SW_HIDE); It can show m_view2,but not like default view. How can I switch views correctly?? opening view with wild mind

      T Offline
      T Offline
      TFrancis
      wrote on last edited by
      #2

      You need to call Create() on m_view2. Then, in your code that switches the view, you need to hide m_view, show m_view2, and then set m_hWndClient to m_view2.

      1 Reply Last reply
      0
      • F fftz

        I need to show more than two views in a sdi frame window. My code like this: RECT rc; GetClientRect(&rc); m_hWndClient = m_view.Create(m_hWnd,rc); m_view.ShowWindow(SW_SHOW); m_view.SetFocus(); m_view2.ShowWindow(SW_HIDE); It can show m_view2,but not like default view. How can I switch views correctly?? opening view with wild mind

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        To add to what TFrancis said, after setting m_hWndClient, call UpdateLayout() to make sure the view is sized correctly to fit the client area of the frame. --Mike-- Personal stuff:: Ericahist Updated Feb 6! | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   -- Buffy

        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