Skip to content

Run the COMServer single Apartment state (STA)? #1

Description

@Daniela88888

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions