Patty,
Assuming that your plug in is running on the main application's UI
thread (which is a reasonable assumption), you have a few options, I
believe. The first is a little hackish. I would create an instance of a
control on the UI thread (before you call out to your thread), something
such as a Panel. However, you would have to make sure that it is not
visible. It ^should^ be created on the same thread that you create it on.
Then, pass the Panel (or rather, its ISynchronizeInvoke implementation, this
is much cleaner) to the other thread, and call Invoke or BeginInvoke.
The other option you have is to expose the class with the methods you
want to call as a COM object. If you create the object with a threading
model of STA, then any calls made to it will be marshaled correctly across
the thread boundary, assuming that you have marshaled the interface pointer
correctly. In order to do this, you would have to get the global interface
table, and then register the interface (through a call to the
RegisterInterfaceInGlobal). This will return a cookie that you can pass
across the thread boundary, and then call GetInterfaceFromGlobal to
retrieve. There is a ton of interop invovled in this scenario, but I think
it is a more proper way of insuring your call is made on the correct thread.
Hope this helps.