views:

233

answers:

1

Hi;

To invoke Clipboard.GetDataObject(), your thread must be running in a single thread appartement (STA).

My application uses a lot of asynchronous operation (Begin/End). The completion methods for those operations are called in a worker MTA thread. Once a thread starts running, I can't modify its thread appartement.

What are the option if I want to use the clipboard in one of those completion methods. I thought of starting a thread in a STA, using some synchronisation primitive to let it do the job and know when it's done.

Or maybe there is a way to instruct the framework that I want all my asynchronous operations running in a STA?

Thank you for your help.