Is there any chance to run the COM server as in STA mode?
I tried these hints found on the internet:
- add [STAThread] to the Main method
- derive SimpleObject from StandardOleMarshalObject
But the SimpleObject is always created in MTA state . The documentation says that the apartment state of the created object is overtaken from the calling thread. SimpleObject is created in the callback method SimpleObjectClassFactory,CreateInstance which is called outside of the scope of CSExeCOMServer.Program.
Does anyone have a solution?