hi there,
I have a .NET application containing a WinForm. This WinForm contains an unmanaged ActiveX control and a few other controls. This application works fine in standalone mode. Now we want to publish some kind of interface so this Winform can be used from unmanaged C++/MFC applications using Interop functionality. The client applications will Show this form in a modeless manner. When the user inputs the details the same are passed to the client using COM event source/sink (or connection point) method.
I have followed various articles and one of the method that works for us is http://codebetter.com/blogs/peter.van.ooijen/archive/2005/06/03/64041.aspx
But if I start more than one thread from the same client application, the second instance of form throws access violation exceptions because the ActiveX control on the form expects the thread to always be a UI thread (based on my observation).
Could you tell me what is the right way to expose a WinForm functionality to unmanaged client applications via Interop?
Many thanks