CWnd::CreateControl error when create .NET control
I'm trying to use the CWnd::CreateControl method to create an .NET UserControl. Everything is ok until the control (window) is closed.
It seems that it is some reference count problem because the code stops at an ASSERT in the CCmdTarget class.
I provide an example. The client is built in VS 6.0 and the usercontrol is built in .NET 2005.
Anyone else that have had the same problem. Please help me with this.
[441 byte] By [
Johan Odin] at [2007-11-11 8:08:19]

# 1 Re: CWnd::CreateControl error when create .NET control
Resolved as Won't Fix by Microsoft on 2006-03-07 at 10:22:19
Thanks for the report. I have good news and bad news.
Visual C++ 6.0 is out of support, so we can't provide any help with your Visual C++ 6.0-related problems, either here or through other support forums.
You note that your problem also reproduces if the same solution is compiled with VS2005. However, VS2005 includes specific MFC support for hosting .NET Controls (CWinFormsControl class and others). You should use these if you are hosting managed controls in an MFC app. The infrasturucture we added in VS2005 includes code to solve the kinds of reference count issues you are seeing in VC6.