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. DLL Dialog

DLL Dialog

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

    Hi all, i like to made a Multidocument .exe where i have the mainframe window with a childwindow and as a second childwindow i like to load a .dll which creates its own dialog. So, how can i fit this upcoming dialog into the MainFrame window as nice as the other child window is fitted in it? I like to have the childwindow dialog at the left and the dll dialog on the right... Thanks, Mark

    A 1 Reply Last reply
    0
    • M macmac38

      Hi all, i like to made a Multidocument .exe where i have the mainframe window with a childwindow and as a second childwindow i like to load a .dll which creates its own dialog. So, how can i fit this upcoming dialog into the MainFrame window as nice as the other child window is fitted in it? I like to have the childwindow dialog at the left and the dll dialog on the right... Thanks, Mark

      A Offline
      A Offline
      Antti Keskinen
      wrote on last edited by
      #2

      I cannot give you a direct code implementation, but I will discuss shortly on how a MDI program handles it's child windows. First, we have the frame window, derived from CMDIFrameWnd. Then, you have a set of CMDIChildWnd objects placed in there. The main frame window is a MDI Frame. The child windows function similarly as a CFrameWnd does, except they rarely have toolbar of their own. So, when in SDI application, a Frame window has one view, then in MDI application, a frame window has many child frames, which each have their own views. Do you understand this ? Following this logic, the easiest way would be to create a CMDIChildWnd object in the DLL, and create a Form View to fill this window's view. This way, you would have two valid MDI child windows, from which the first would have a normal view and the other one a form view. I would follow this approach, because I am unsure how a modeless dialog works when it is a child of a MDI frame window. I have never tested it myself. But using the CMDIChildWnd->FormView approach would give valid, working results, as both child windows would then be CMDIChildWnd objects, and would have all the necessary implementation ready for functioning as MDI childs. When the windows are created, you must position them appropriately using SetWindowPos member of CMDIChildWnd. Just get the client rectangle of the parent frame (CMDIFrameWnd::GetClientRect), divide it to half X-wise, and use these values to determine the size and position of both windows. First window should be from (0, 0) -> (X / 2, Y) and the other from (X / 2, 0) -> (X, Y), where X and Y are the width and height of the client area, respectively. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

      M 1 Reply Last reply
      0
      • A Antti Keskinen

        I cannot give you a direct code implementation, but I will discuss shortly on how a MDI program handles it's child windows. First, we have the frame window, derived from CMDIFrameWnd. Then, you have a set of CMDIChildWnd objects placed in there. The main frame window is a MDI Frame. The child windows function similarly as a CFrameWnd does, except they rarely have toolbar of their own. So, when in SDI application, a Frame window has one view, then in MDI application, a frame window has many child frames, which each have their own views. Do you understand this ? Following this logic, the easiest way would be to create a CMDIChildWnd object in the DLL, and create a Form View to fill this window's view. This way, you would have two valid MDI child windows, from which the first would have a normal view and the other one a form view. I would follow this approach, because I am unsure how a modeless dialog works when it is a child of a MDI frame window. I have never tested it myself. But using the CMDIChildWnd->FormView approach would give valid, working results, as both child windows would then be CMDIChildWnd objects, and would have all the necessary implementation ready for functioning as MDI childs. When the windows are created, you must position them appropriately using SetWindowPos member of CMDIChildWnd. Just get the client rectangle of the parent frame (CMDIFrameWnd::GetClientRect), divide it to half X-wise, and use these values to determine the size and position of both windows. First window should be from (0, 0) -> (X / 2, Y) and the other from (X / 2, 0) -> (X, Y), where X and Y are the width and height of the client area, respectively. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

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

        Yep, thanks. But it is a thirdparty .dll. I don t know if there is an childframe obj in it. Maybe.. Thanks, Mark

        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