title: C++ MFC how to use GetDlgItem()
body: <p>This is in the main "example dlg.cpp" file:</p>
  
  <pre><code>void CHelixV3Dlg::OnBnClickedCancel()
  {
     CEdit* editbox = (CEdit*)GetDlgItem(IDC_EDIT1); 
    //works fine, defined as: *CWnd GetDlgItem(int nID); in this file
  }
  </code></pre>
  
  <p>This is test.cpp source file</p>
  
  <pre><code>void test()
  {
     CEdit* editbox = (CEdit*)GetDlgItem(IDC_EDIT1);
     //does not work at all, seems to be a winAPI function instead of MFC...
     //defined as: HWND __stdcall GetDlgItem(HWND hDlg, int nIDDlgItem);
  }
  </code></pre>
  
  <p>both source files are in the same project, use the same headers, but test()'s GetDlgItem is obviously a Win32 API function, which does not work in MFC...
  How could I get GetDlgItem() working in the test.cpp file?</p>