1
votes

I'm trying to host a managed control (C#/.Net) inside an ActiveX Control (MFC/C++/CLR Enabled.)

I've been able to use CWinFormsControl successfully from an MFC View based application, but I haven't figured out how to host one in an ActiveX Control. The ActiveX control is CLR enabled. We're attempting to do this because we have a legacy MFC application that needs to make use of a third party managed control, and we must host it inside of our own ActiveX control, which is then hosted in our application. Long story, but this is how it must work.

Any pointers?

1

1 Answers

2
votes

You need to look into interop between COM and .NET. As far as I remember, you can start by making your .NET component COM visible for your ActiveX control. After that, your .NET component acts as another COM component.

Here is an article about the interop. I believe you need to read Part II.