On using Windows Forms controls as ActiveX controls
[Update: Reformatted and edited the quote below]
Here is a great summary by Mark Boulter (Tech Lead on .NET Client Team):
To summarize our official position on using Windows Forms controls as ActiveX controls:
- v1.0 of Windows Forms only supports using Windows Forms controls in Windows Forms and IE 5.x
- In v1.1 of the Framework we extended our hosting support to include using Windows Forms controls in MFC 7.x and up or any container that is fully compatible with the MFC 7.x ActiveX control container.
- However we do not support registration of Windows Forms controls as ActiveX controls and we do not support CoCreateInstance of Windows Forms controls. We only support managed activation of the Windows Forms controls. Once the controls are created they can be hosted in MFC just as you would any other ActiveX control. This article by Chris Sells explains how to do this.
Comments
- Anonymous
January 15, 2004
Any comments on how this is going to change in Whidbey and C++/CLI? I sure hope it's going to be eaiser (both directions) - I guess it can't be much harder. :-) - Anonymous
January 16, 2004
Daniel: I am checking up with some folks here on what is planned for Whidbey. I will post any information I get when I hear back from them. - Anonymous
August 08, 2005
VS 2005 supports hosting Windows forms inside MFC applications. It is done using hosting of ActiveX controls and works for dialogs and MDI/SDI applications. More information in corresponding sections of MSDN, http://msdn2.microsoft.com/library/ahdd1h97(en-us,vs.80).aspx. I also updating my blog (blogs.msdn.com/nikolad) with any relevant information about this feature. - Anonymous
August 23, 2005
and where is the article? - Anonymous
August 24, 2005
Which one do you mean - the one by Chris Sells? Click the 'This' link in the post. - Anonymous
January 26, 2007
In response to a comment on my previous post on this topic, I emailed some folks internally to find out