My Project Consists of Four Items
- C# DLL Which Exposes a COM Interface via Interop
- A WPF Control which contains an Instance of an exposed class in 1
- A Winform ActiveX which hosts the WPF control in 2 using ElementHost
- An MFC Dialog Application using the Control from 3
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.
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.
The ActiveX works well and displays all the WPF data nicely.
So the question is how do I get a pointer to the ActiveX control from within the MFC app without using CWinFormControl?
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.
Any ideas?