COM interopt all STA?
Question: Are all interopt components used in WinForms forced to be STA threading model? Its seems this might be a serious limitation if this is true.
Thanks,
Eric
Question: Are all interopt components used in WinForms forced to be STA threading model? Its seems this might be a serious limitation if this is true.
Thanks,
Eric
We are working on ways to make it easier to program against this model, however. In the meantime, you need to make sure you only call Windows Forms classes and wrapped COM objects on the thread which created them. See the Control.Invoke/Begin invoke methods for ways of doing this.
STA is ok for most situations. However, once I deploy my application as a smart client, All calls to COMs fail due to the threading model
Also, the dragdrop registration fail as well. Is there a work around?
Is there any article that talks about the threading model between a thick and a smart client?
Thanks
Thomas
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
System.Threading.Thread.CurrentThread.ApartmentState = System.Threading.ApartmentState.STA;