Based on my experience, when we create an instance of a Microsoft Windows
Form from a COM client application, the form may behave unexpectedly. For
example, when we create an instance of the form from a Microsoft Visual
Basic 6.0 application or from a Microsoft Foundation Classes (MFC)
application, the focus does not change from one control to another control
when we press TAB. We may also experience unexpected behavior for
keystrokes or for mouse activity.
This behavior occurs because the message loop that the Windows Form uses
and the message loop that the COM client application provides are
To make a Windows Form work correctly from a COM client application, you
must run it on a Microsoft .NET Framework message loop. To do this, use one
of the following methods:
1) Use the ShowDialog method to display the Windows Form
2) Display each Windows Form on a new thread
3) Create a shared message loop on a new thread in the .NET Framework
For detailed codes on the above methods, you may refer to this KB article:
"You experience unexpected behavior when you use Windows Forms in COM
By the way, I noticed the following in your description:
"a WindowsForm whose code base is VS 2003 C++/MFC"
"a WindowsForm that is strictly .NET"
Could you describe more on those? Does item2 means a winform application
created by Visual C# application wizard? item1 means a VC++ MFC dialog
based application? (if that, the item1 is not a winform app). If the
problem can not be resolved by the above methods, please create a simple
repro sample and email to me. I will test it on our side and dig more. You
can reach me by removing online from my email address here.
Thanks very much.
Microsoft Community Support
Get Secure! www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
This posting is provided "AS IS" with no warranties, and confers no rights.