title: How to Access Winform ActiveX Control in MFC No CLR
body: <p>My Project Consists of Four Items</p>
  
  <ol>
  <li>C# DLL Which Exposes a COM Interface via Interop</li>
  <li>A WPF Control which contains an Instance of an exposed class in 1 </li>
  <li>A Winform ActiveX which hosts the WPF control in 2 using ElementHost</li>
  <li>An MFC Dialog Application using the Control from 3</li>
  </ol>
  
  <p>The Winform ActiveX (3) exposes the class instance from 1 via a function in 2. I wish to access this class instance from the MFC dialog application through the ActiveX. I have looked around and found you can do this using CWinFormControl. However I am not at liberty to recompile the MFC app using /clr. Therefore I cannot use CWinFormControl. </p>
  
  <p>I can access the class in 1 via COM from the MFC app and run all the functions etc however the class is a different instance as the DLL is loaded in its own space. </p>
  
  <p>The ActiveX works well and displays all the WPF data nicely.</p>
  
  <p>So the question is how do I get a pointer to the ActiveX control from within the MFC app without using CWinFormControl? </p>
  
  <p>I have tried importing the TLB from the ActiveX and attempting to create a "Variable" for it in the Class wizard but it reports that the TLB is unavailable. I have also tried directly creating a DDX entry by manually creating a variable but DDX doesn't allow pointers.</p>
  
  <p>Any ideas?</p>