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. C / C++ / MFC
  4. MDI without Doc/view

MDI without Doc/view

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

    HI i want to use different captions for each MDI child window i create. i am creating it using CreateNewChild function. also how to assign some values for each child i create so that i can iterate over them or identify them using that value. Thanx'n'advance

    N 1 Reply Last reply
    0
    • C CodeMak

      HI i want to use different captions for each MDI child window i create. i am creating it using CreateNewChild function. also how to assign some values for each child i create so that i can iterate over them or identify them using that value. Thanx'n'advance

      N Offline
      N Offline
      Nelek
      wrote on last edited by
      #2

      I made it (Inside DOC/VIEW architechture) in the CChildFrm::PreCreateWindow (CREATESTRUCT &cs). If you have that class, perfect. If not... take a look into your docu to that function, maybe it helps you to find out how to do it.

      Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson ;)

      C 2 Replies Last reply
      0
      • N Nelek

        I made it (Inside DOC/VIEW architechture) in the CChildFrm::PreCreateWindow (CREATESTRUCT &cs). If you have that class, perfect. If not... take a look into your docu to that function, maybe it helps you to find out how to do it.

        Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson ;)

        C Offline
        C Offline
        CodeMak
        wrote on last edited by
        #3

        ya i too have those class n functions available... plz help me in detail...

        1 Reply Last reply
        0
        • N Nelek

          I made it (Inside DOC/VIEW architechture) in the CChildFrm::PreCreateWindow (CREATESTRUCT &cs). If you have that class, perfect. If not... take a look into your docu to that function, maybe it helps you to find out how to do it.

          Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson ;)

          C Offline
          C Offline
          CodeMak
          wrote on last edited by
          #4

          ya i too have those class n function available.. plz help me in detail... NOTE: I am creating child window using CreateNewChild.. how can i make use of cs.lpCreateParams.

          N 1 Reply Last reply
          0
          • C CodeMak

            ya i too have those class n function available.. plz help me in detail... NOTE: I am creating child window using CreateNewChild.. how can i make use of cs.lpCreateParams.

            N Offline
            N Offline
            Nelek
            wrote on last edited by
            #5

            This is more or less what I made.

            BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
            {
            if( !CMDIChildWnd::PreCreateWindow(cs) )
            return FALSE;

            // Set the configuration for the different Views
            extern CFPSDoc\* m\_pDoc;
            

            ;
            if ((m_pDoc) && (m_pDoc->m_szNewFrameName != ""))
            { cs.style = WS_SYSMENU | WS_CAPTION | WS_OVERLAPPED; //This is the main View (CScrollView)
            ;
            //All following type of views are from CFormView derived
            if (m_pDoc->m_szNewFrameName == "ViewType1")
            { int nMax = 0;
            if (m_pDoc->m_cmlMyList1.GetCount () >= m_pDoc->m_cmlMyList2.GetCount ())
            nMax = m_pDoc->m_cmlMyList1.GetCount ();
            else
            nMax = m_pDoc->m_cmlMyList2.GetCount ();

            		cs.cx = 500;
            		cs.cy =  (40 + (25 \* nMax));   //Variable Frame height according to number of elements
            		m\_pDoc->m\_szNewFrameName = "This is the Type of view 1 in project \\"" + m\_pDoc->GetTitle () + "\\"";
            	}
            	else if (m\_pDoc->m\_szNewFrameName == "ViewType2")
            	{	cs.cx = 528;				cs.cy =  322;
            		m\_pDoc->m\_szNewFrameName = "Second type of View in project \\"" + m\_pDoc->GetTitle () + "\\"";
            		cs.style = cs.style | WS\_MINIMIZEBOX;
            	}
            	else if (m\_pDoc->m\_szNewFrameName == "ViewType2\_Not\_Visible")
            	{	cs.cx = 1;				cs.cy =  1;
            		m\_pDoc->m\_szNewFrameName = "";
            		cs.style = cs.style | WS\_MINIMIZE; //this is to have access to some functions coded in the view of second type, but without having the view itself.
            	}
            	else if (m\_pDoc->m\_pObj1 || m\_pDoc->m\_pObj2)  //if one particular element is selected
            	{	cs.cx = 415;				cs.cy = 260;
            		cs.style = cs.style | WS\_MINIMIZEBOX;
            	}
            	else if ((m\_pDoc->m\_pObj3) && (m\_pDoc->m\_pObj3->m\_nType == 0)) //if the other type of element is from one subtype
            	{	cs.cx = 517;				cs.cy = 421;
            		cs.style = cs.style | WS\_MINIMIZEBOX;
            	}
            	else if ((m\_pDoc->m\_pObj3) && (m\_pDoc->m\_pObj3->m\_nType == 2)) //if the other subtype
            	{	cs.cx = 610;				cs.cy = 435;
            		cs.style = cs.style | WS\_MINIMIZEBOX;
            	}
            

            ;
            cs.lpszName = m_pDoc->m_szNewFrameName; //Assigning the correspondent title to the frame
            }
            return TRUE;
            }

            This is what I use to configure the different type of views that may be opened. Up to 50 different views in 6 different configurations. Was that what you were asking for? If not... sorry. I didn't understand what you told me the ";" are used just to avoid the cancellation of empty lines

            Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution...

            C 1 Reply Last reply
            0
            • N Nelek

              This is more or less what I made.

              BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
              {
              if( !CMDIChildWnd::PreCreateWindow(cs) )
              return FALSE;

              // Set the configuration for the different Views
              extern CFPSDoc\* m\_pDoc;
              

              ;
              if ((m_pDoc) && (m_pDoc->m_szNewFrameName != ""))
              { cs.style = WS_SYSMENU | WS_CAPTION | WS_OVERLAPPED; //This is the main View (CScrollView)
              ;
              //All following type of views are from CFormView derived
              if (m_pDoc->m_szNewFrameName == "ViewType1")
              { int nMax = 0;
              if (m_pDoc->m_cmlMyList1.GetCount () >= m_pDoc->m_cmlMyList2.GetCount ())
              nMax = m_pDoc->m_cmlMyList1.GetCount ();
              else
              nMax = m_pDoc->m_cmlMyList2.GetCount ();

              		cs.cx = 500;
              		cs.cy =  (40 + (25 \* nMax));   //Variable Frame height according to number of elements
              		m\_pDoc->m\_szNewFrameName = "This is the Type of view 1 in project \\"" + m\_pDoc->GetTitle () + "\\"";
              	}
              	else if (m\_pDoc->m\_szNewFrameName == "ViewType2")
              	{	cs.cx = 528;				cs.cy =  322;
              		m\_pDoc->m\_szNewFrameName = "Second type of View in project \\"" + m\_pDoc->GetTitle () + "\\"";
              		cs.style = cs.style | WS\_MINIMIZEBOX;
              	}
              	else if (m\_pDoc->m\_szNewFrameName == "ViewType2\_Not\_Visible")
              	{	cs.cx = 1;				cs.cy =  1;
              		m\_pDoc->m\_szNewFrameName = "";
              		cs.style = cs.style | WS\_MINIMIZE; //this is to have access to some functions coded in the view of second type, but without having the view itself.
              	}
              	else if (m\_pDoc->m\_pObj1 || m\_pDoc->m\_pObj2)  //if one particular element is selected
              	{	cs.cx = 415;				cs.cy = 260;
              		cs.style = cs.style | WS\_MINIMIZEBOX;
              	}
              	else if ((m\_pDoc->m\_pObj3) && (m\_pDoc->m\_pObj3->m\_nType == 0)) //if the other type of element is from one subtype
              	{	cs.cx = 517;				cs.cy = 421;
              		cs.style = cs.style | WS\_MINIMIZEBOX;
              	}
              	else if ((m\_pDoc->m\_pObj3) && (m\_pDoc->m\_pObj3->m\_nType == 2)) //if the other subtype
              	{	cs.cx = 610;				cs.cy = 435;
              		cs.style = cs.style | WS\_MINIMIZEBOX;
              	}
              

              ;
              cs.lpszName = m_pDoc->m_szNewFrameName; //Assigning the correspondent title to the frame
              }
              return TRUE;
              }

              This is what I use to configure the different type of views that may be opened. Up to 50 different views in 6 different configurations. Was that what you were asking for? If not... sorry. I didn't understand what you told me the ";" are used just to avoid the cancellation of empty lines

              Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution...

              C Offline
              C Offline
              CodeMak
              wrote on last edited by
              #6

              Thanks man.. This will solve my problem. Cheers....

              N 1 Reply Last reply
              0
              • C CodeMak

                Thanks man.. This will solve my problem. Cheers....

                N Offline
                N Offline
                Nelek
                wrote on last edited by
                #7

                You are wellcome :)

                Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

                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