title: m_hWnd member variable is null
body: <p>I'm trying to get the handle of a dialog box with this code:</p>
  
  <pre><code>class CStatisticsDlg : public CDialogEx
  {
  public:
      CStatisticsDlg();
  
  // Dialog Data
      enum { IDD = IDD_STATISTICS };
  
  protected:
      virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  
  // Implementation
  protected:
      DECLARE_MESSAGE_MAP()
  public:
  };
  
  CStatisticsDlg::CStatisticsDlg() : CDialogEx(CStatisticsDlg::IDD)
  {
  }
  
  void CStatisticsDlg::DoDataExchange(CDataExchange* pDX)
  {
      CDialogEx::DoDataExchange(pDX);
      //  DDX_Control(pDX, IDC_FUCK, m_fuck);
  }
  
  BEGIN_MESSAGE_MAP(CStatisticsDlg, CDialogEx)
  END_MESSAGE_MAP()
  </code></pre>
  
  <p>But when I create an instance of the class with this:</p>
  
  <pre><code>CStatisticsDlg statisticsDlg;
  </code></pre>
  
  <p>and try to get its handle via <code>statisticsDlg.m_hWnd</code>, the handle is null.</p>
  
  <p>Why this is the case? What is the best way to get the handle for a dialog box?</p>