title: MFC use C# controlLibrary, crash in DDX_ManagedControl (CLR)
body: <p>I am trying to use windows forms (C#) in the MFC C++ and <a href="http://msdn.microsoft.com/en-us//library/1te0bbs8%28v=vs.90%29.aspx" rel="nofollow">follow these step</a>. I have succeeded in this.</p>
  
  <p>But, I make this project be a MFCDlg.dll
  and put the MFCDlg.dll and WindowsControlLibrary1.dll (C#) in other project.</p>
  
  <p>when i run the application it crashes at:</p>
  
  <pre><code>/*virtual*/void CXSScheduleUIDlg::DoDataExchange(CDataExchange* pDX)
  {
      CDialogEx::DoDataExchange(pDX);
      DDX_ManagedControl(pDX, IDC_SCHEDULE_GANTT, m_ctrlGantt);   Here
  }
  </code></pre>
  
  <p>And show this error:</p>
  
  <blockquote>
    <p><em>An unhandled exception of type 'System.AccessViolationException'
    occurred in mfcDlg.dll</em></p>
  </blockquote>
  
  <p>What can be causing this?</p>