How to specify C# DLL method for [MTAThread]
How to specify [MTAThread] methods for C# DLL ?
[MTAThread]
public int connect(string hostname, int param) ;
Seems don't work. Or this is correct way ? I have executable with main function ([MTA开发者_开发技巧Thread] option) and everything works (same code).
The STAThead and MTAThread attributes are only taken into account when applied on your applications Main startup method. For other threads, you can set the Thread.ApartmentState property.
精彩评论