G
Guest
Hello,
I have a worker thread that needs to call a method that only works on the
main/UI thread. One way to accomplish this in managed code is to use
Control.Invoke. However, in my case I don't have a .NET UI control from
which I can call Invoke. I have tried to create a temporary, invisible
Windows form and call Invoke against this, and while this sort of worked, it
highlighted additional problems (which I have not resolved) and is generally
not a very clean solution.
If I were writing in unmanaged code, I would likely use
CoMarshalInterThreadInterfaceInStream. I could also post a message back to
the main thread. Is something like this possible in managed code or are
there ways other than Control.Invoke to pass an interface pointer to a
different thread?
One other potential challenge is that my code is not responsible for
starting the secondary thread; it is started by the framework in which my
code executes. For a detailed discussion of what exactly I'm trying to
accomplish, see
http://groups.google.ca/group/micro...onitorselection&rnum=1&hl=en#153ce7d2f03e67e3.
Thanks!
Notre
I have a worker thread that needs to call a method that only works on the
main/UI thread. One way to accomplish this in managed code is to use
Control.Invoke. However, in my case I don't have a .NET UI control from
which I can call Invoke. I have tried to create a temporary, invisible
Windows form and call Invoke against this, and while this sort of worked, it
highlighted additional problems (which I have not resolved) and is generally
not a very clean solution.
If I were writing in unmanaged code, I would likely use
CoMarshalInterThreadInterfaceInStream. I could also post a message back to
the main thread. Is something like this possible in managed code or are
there ways other than Control.Invoke to pass an interface pointer to a
different thread?
One other potential challenge is that my code is not responsible for
starting the secondary thread; it is started by the framework in which my
code executes. For a detailed discussion of what exactly I'm trying to
accomplish, see
http://groups.google.ca/group/micro...onitorselection&rnum=1&hl=en#153ce7d2f03e67e3.
Thanks!
Notre