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. how to combine to dialog boxes and a formview in a single application ..

how to combine to dialog boxes and a formview in a single application ..

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
6 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.
  • M Offline
    M Offline
    mirraa
    wrote on last edited by
    #1

    i'm having two dialog boxes and a formview..now i want t combine all these in a single view..that is the resultant application should contain the formview and one dialog bix at side of form view and another at the down so that if we want we can close those dialog boxes as in vc++ editor(msdev).., i thought to try with plug ins..,as for plug ins are concerned i'm not getting any clear material to know about it..shall i try with plug ins..,if so how...or any other method... Please help me by ur suggestions..thanx n advance.. P.S:All the dialogboxes nd formview are seperate programs...

    N 1 Reply Last reply
    0
    • M mirraa

      i'm having two dialog boxes and a formview..now i want t combine all these in a single view..that is the resultant application should contain the formview and one dialog bix at side of form view and another at the down so that if we want we can close those dialog boxes as in vc++ editor(msdev).., i thought to try with plug ins..,as for plug ins are concerned i'm not getting any clear material to know about it..shall i try with plug ins..,if so how...or any other method... Please help me by ur suggestions..thanx n advance.. P.S:All the dialogboxes nd formview are seperate programs...

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

      Hi, why don't you try with a splitter window and 2 CFormViews? Or a DialogBox in NonModal message that you change the size and position in its OnInitDialog () with SetWindowPos () without caption and frame if you want (you can change this in resource editor or using WS_ styles and flags.

      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?

      M 1 Reply Last reply
      0
      • N Nelek

        Hi, why don't you try with a splitter window and 2 CFormViews? Or a DialogBox in NonModal message that you change the size and position in its OnInitDialog () with SetWindowPos () without caption and frame if you want (you can change this in resource editor or using WS_ styles and flags.

        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?

        M Offline
        M Offline
        mirraa
        wrote on last edited by
        #3

        hi nelek, actually i've designed one dialog box with treeview,another with tab view,and formview is an editor as vc++ editor.. more or less i've to create vc++ lookalike editor...so if we want to close treeview we have to close it,so the other dialog box nd formview... in splitter window v can't close seperate windows!!(isn't it?)

        N 1 Reply Last reply
        0
        • M mirraa

          hi nelek, actually i've designed one dialog box with treeview,another with tab view,and formview is an editor as vc++ editor.. more or less i've to create vc++ lookalike editor...so if we want to close treeview we have to close it,so the other dialog box nd formview... in splitter window v can't close seperate windows!!(isn't it?)

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

          Hi mirraa, actually you can close all the opened windows/dialogs in one touch. For example, in my app (MDI in VC++ 6) I have one CScrollView as MainView and up to 48 CFormViews for each element I want to introduce its parameters. When I close one SecondaryView I close it, and when I close the MainView I close ALL the others. I do this with:

          BOOL CMyDoc::CanCloseFrame(CFrameWnd* pFrame)
          { int nError = 0;
          //With this I separate between added Views from MainView and close it when match
          CView* pFrmView = pFrame->GetActiveView ();
          if (pFrmView->IsKindOf (RUNTIME_CLASS (CFormView)))
          return TRUE;
          //If I’m trying to close the main, I close all the others before
          POSITION pos = GetFirstViewPosition ();
          while (pos)
          { CView* pView = GetNextView (pos);
          if (pView->IsKindOf (RUNTIME_CLASS (CFormView)))
          { CFrameWnd* pTempFrame = pView->GetParentFrame ();
          if (pTempFrame)
          pTempFrame->DestroyWindow ();
          }
          }

          return CDocument::CanCloseFrame(pFrame);
          

          }

          The only difference with the DialogBoxes is that you don't have this list for opened Views in Document. But you can also made it by yourself. Just create a CWnd* dlgArray [MAX] or hWnd dlgArray [MAX] and, in every DialogBox, take a pointer (or a handle, whatever you like more) to the opened DialogBox in the OnInitDialog. Afterwards you can close them as well with a call to DestroyWindow, CloseDialog or other functions like those.

          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?

          M 1 Reply Last reply
          0
          • N Nelek

            Hi mirraa, actually you can close all the opened windows/dialogs in one touch. For example, in my app (MDI in VC++ 6) I have one CScrollView as MainView and up to 48 CFormViews for each element I want to introduce its parameters. When I close one SecondaryView I close it, and when I close the MainView I close ALL the others. I do this with:

            BOOL CMyDoc::CanCloseFrame(CFrameWnd* pFrame)
            { int nError = 0;
            //With this I separate between added Views from MainView and close it when match
            CView* pFrmView = pFrame->GetActiveView ();
            if (pFrmView->IsKindOf (RUNTIME_CLASS (CFormView)))
            return TRUE;
            //If I’m trying to close the main, I close all the others before
            POSITION pos = GetFirstViewPosition ();
            while (pos)
            { CView* pView = GetNextView (pos);
            if (pView->IsKindOf (RUNTIME_CLASS (CFormView)))
            { CFrameWnd* pTempFrame = pView->GetParentFrame ();
            if (pTempFrame)
            pTempFrame->DestroyWindow ();
            }
            }

            return CDocument::CanCloseFrame(pFrame);
            

            }

            The only difference with the DialogBoxes is that you don't have this list for opened Views in Document. But you can also made it by yourself. Just create a CWnd* dlgArray [MAX] or hWnd dlgArray [MAX] and, in every DialogBox, take a pointer (or a handle, whatever you like more) to the opened DialogBox in the OnInitDialog. Afterwards you can close them as well with a call to DestroyWindow, CloseDialog or other functions like those.

            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?

            M Offline
            M Offline
            mirraa
            wrote on last edited by
            #5

            actually i couldn't understand ur logic..i need all the dialogbox and formview in a single appln as vc++ editor ,so that i can close them with mouse..my project is exactly like a vc++ editor...shall i use plug ins?if so how...?how 'll i combine three programs in a single program..since my dialog with tree view s a sep pgm,my tabview dialog is a seperate pgm nd form view is a sep pgm...please suggest me ...thanx n advance...

            N 1 Reply Last reply
            0
            • M mirraa

              actually i couldn't understand ur logic..i need all the dialogbox and formview in a single appln as vc++ editor ,so that i can close them with mouse..my project is exactly like a vc++ editor...shall i use plug ins?if so how...?how 'll i combine three programs in a single program..since my dialog with tree view s a sep pgm,my tabview dialog is a seperate pgm nd form view is a sep pgm...please suggest me ...thanx n advance...

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

              Then I would make it with a SDI application not with dialogs, and make a splitter window to add two views more. At left, one CTreeView derived to the "explorer", then a CSrollBar derived to work with and the third... it depends on what you want to make. The problem of using more views, is that you can not change to a new doc if you dont close all views, at least in my project. Because of that I'm using that function to close the "added" views first when I close the main view.

              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?

              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