tags:

views:

22

answers:

1

From what I understand, when a COM component marked as using STA is used from a MTA 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.

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?

A: 

I think this article will clear things up:

Calling an STA COM Object from a WCF Operation

It's fairly recent so should be relevant.

Kev
It looks relevant, but unfortunately, it only deals with synchronous calls on STA COM components. If I do the same, synchronous operations to appear to be working, but I don't get any callbacks from the COM component.
Freed
@freed - ah that's unfortunate. It was a stab in the dark.
Kev