title: How can I display a nested CDialog within another CDialog?
body: <p>I have two CDialog classes that I have created. Let's call them MainDialog and ExtraDialog. I want ExtraDialog to be able to be displayed both through doModal and as a nested dialog within MainDialog.</p>
  
  <p>I can already bring it up separately through a Button and doModal. However, I've been stuck about how to place it within MainDialog.</p>
  
  <pre><code>CWnd* m_pWndStatic = new CWnd;
  m_pWndStatic-&gt;Create(_T("Something"), _T("Title"), WS_CHILD | WS_VISIBLE, CRect(x, y, xEnd, yEnd), this, idWnd);
  
  CExtraDialog* dlg = new CExtraDialog;
  dlg-&gt;Create(IDD_NEW_DIALOG, this); //Or second variable can be m_pWndStatic?
  //dlg-&gt;SetWindowPos(m_pWndStatic, x, y, xEnd, yEnd, SWP_NOZORDER | SWP_NOACTIVATE);
  //dlg-&gt;Invalidate();
  //dlg-&gt;ShowWindow(SW_SHOW);
  //m_pWndStatic-&gt;ShowWindow(SW_SHOW);
  </code></pre>
  
  <p>Above I shared some of the thigns I have tried. I was hoping to create a CWnd and put the dialog inside the CWnd but I feel like I am missing something and I couldn't really find anything helpful online.</p>
  
  <p>Edit: I am basically trying to put multiple CWnds into one CDialog, and having the CWnd's run different functionalities from different classes. Kinda like putting lego blocks together.</p>
  
  <p>Edit2: I found a question that is kinda similar? I hope to make it similar but I just don't want buttons and I want two of them get displayed at once.  <a href="https://stackoverflow.com/questions/22763629/embedding-dialogs-in-main-dialog-and-switching-them-with-button-click-in-mfc">Embedding dialogs in main dialog and switching them with button click in MFC</a> </p>