title: MFC: Emdedded child dialog is not showing up within parent dialog
body: <p>I came across a <a href="https://www.codeproject.com/Articles/4087/How-to-implement-a-scrollable-child-dialog" rel="nofollow noreferrer">tutorial</a> showing how to embed a child dialog within a parent dialog using MFC. I am using Visual Studio 2015. My setup is as follows. Using the Visual Studio MFC Application Wizard to create a new MFC Visual C++ Project called <code>MFCApplication3</code>, I select a <strong>Dialog based</strong> application where MFC is used in a <strong>Shared DLL</strong>. Using boilerplate code, I have a simple Thick Frame Dialog, no maximize or minimize box. </p>
  
  <p>In my resource view, I go to my Dialog editor to edit the main dialog. I add a picture control with a blank area in the center and name it <code>IDC_STATIC</code>. This will simply be used as a placeholder for my child dialog that I wish to embed. It looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/Fx7I3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fx7I3.png" alt="MFC Basic Dialog with Placeholder"></a></p>
  
  <p>Still in the resource view, I create a new Dialog. I call it IDD_CHILD. I add some components. It looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ZlWZk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZlWZk.png" alt="MFC Dialog no border"></a></p>
  
  <p>Now back in the Solution Explorer, I add a class using the Add Class wizard, selecting to add an MFC Class. The class name is <code>CChildDialog</code>, with a base class of <code>CDialog</code>, and I use the already generated <code>IDD_CHILD</code> as the Dialog ID. It generates the <code>.cpp</code> and associated <code>.h</code> file. In the constructor of <code>CChildDialog</code>, I add a call to the <code>Create</code> function so the constructor becomes:</p>
  
  <pre><code>CChildDialog::CChildDialog(CWnd* pParent /*=NULL*/)
      : CDialog(IDD_CHILD, pParent)
  {
      Create(IDD_CHILD, pParent);
  }
  </code></pre>
  
  <p>Now I modify the dialog code generated automatically when I created the project. In <code>CMFCApplication3Dlg.h</code>, I add a <code>private</code> member of type <code>CChildDialog*</code> called <code>m_childDlg</code>, and <code>#include</code> the associated header file. In <code>CMFCApplication3Dlg.cpp</code>, I add this to the <code>OnInitDialog</code> function prior to the <code>return</code> statement:</p>
  
  <pre><code>CRect rc;
  GetDlgItem(IDC_STATIC)-&gt;GetWindowRect(rc);
  ScreenToClient(&amp;rc);
  
  m_childDlg = new CChildDialog(this);
  m_childDlg-&gt;MoveWindow(rc);
  </code></pre>
  
  <p>Now I build the solution, run it, but it looks like it does in the first picture. A blank placeholder spot for a child dialog, but no child dialog. What could I be doing wrong?</p>