title: How are STA COM components handled when used in a WCF service hosted in IIS (7+)?
body: <p>From what I understand, when a COM component marked as using <a href="https://en.wikipedia.org/wiki/Component_Object_Model#Threading" rel="nofollow">STA</a> is used from an <a href="https://en.wikipedia.org/wiki/Component_Object_Model#Threading" rel="nofollow">MTA</a> thread, the calls are supposed to be marshalled to an STA thread and executed from that dedicated thread. In the case of a Windows client application, this would mean that it would execute on the UI thread (if marked as STA), and that callbacks from the COM component to me would be handled by Windows messages sent to a hidden window and processed on the Windows message loop.</p>
  
  <p>What happens though if I use a STA COM component in a WCF service hosted in IIS? Will the worker process have a Windows message loop on a STA thread? Can I fire up my own STA thread with its own message loop?</p>