RunWorkerCompleted call from worker thread in VB CCW

G

Guest

I have a .net library with backgroundWorker object, and it is working fine in
..net environment. Then I exposes the library to VB application to call. Using
standard Callable COM Wrapper (CCW) method, the method can be called, but I
notice that backgroundWorker_RunWorkerCompleted() method will be called from
worker thread, instead of the main thread. And eventually throw exception in
my side as some UI are updated in RunWorkerCompleted method.

Is it a known issue from Microsoft?
 
G

Guest

You need to use the Control.InvokeRequired property to check whether you are
on the UI thread and if not (true from prop), call invoke.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top