title: CWnd::CreateDlgIndirect leaves m_hWnd==NULL
body: <p>A dialog I'm working on isn't displaying, using:</p>
  
  <pre><code>CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,CWnd* pParentWnd, HINSTANCE hInst)
  </code></pre>
  
  <p>The call to CreateDlgIndirect is in a lon-used base-class, which effectively takes the IDD of the dialog template in the resource file - it works fine for many other dialogs but I can't see what's different in my dialog. My dialog works fine when created in a more normal way, but I have to use the base class as it has loads of other functionality built in.</p>
  
  <p>What I find when trawling through CWnd::CreateDlgIndirect in dlgcore.cpp, is that the plain Win32 API call is failing:</p>
  
  <pre><code>hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,pParentWnd-&gt;GetSafeHwnd(), AfxDlgProc);
  </code></pre>
  
  <p>I can't step into that function for some reason, so all I see is the HWND is NULL.</p>
  
  <p>Can anyone suggest what kind of problems might be causing this? I compared the two dialog resource templates and their properties are the same.</p>
  
  <p>edit: I have one custom control on the dialog. When I remove this, it works. No idea why, what difference might this make?</p>