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 ([MTAThread] option) and everything works (same code).
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 ([MTAThread] 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.