First of all, here is the simplest advice: don't use any stupid and obsolete ActiveX controls for TCP communications. Just listen how it sounds: ActiveX? In .NET? Seriously?
Instead, you can use the sockets, or, even better and simpler, the class
System.Net.Sockets.TcpListener
. which is also the part of sockets API, wrapped for your convenience:
https://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener%28v=vs.110%29.aspx,
https://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener%28v=vs.110%29.aspx.
Also, I don't know why you decided that Way#1 cannot be used for a service. A service application also has the entry point method, so you can apply the attribute
[System.STAThread]
to it.
And of course you always could use Way#2. You did not provide any information on why it did not work, but you could face different problems by different reasons. For example, you could create this
STAThread
but still do something problematic not in this thread, but in some other thread. :-)
—SA