vsto - Outlook AddIn: How can I call InvokeRequired? -


in outlook 2013 vsto addin, have code:

private sub thisaddin_startup(byval sender object, byval e system.eventargs) handles me.startup     task.run(sub() dostuff()) end sub  private sub dostuff()     ' long task stuff     call stuffdone()  end sub  private sub stuffdone()     if ????.invokerequired         ????.invoke(new methodinvoker(addressof stuffdone))         exit sub     end if      dim f new form1     f.show() end sub 

but don't know how call invokerequired since there's no mainform??

thanks

why feel need call invokerequired?

what i'm doing in case include windows form in vsto project. pass outlook application reference add-in windows form , windows form may spawn 1 or more threads may receive , access outlook application (after locking on reference). windows form methods threads call update gui have invokerequired check mentioned. can't guarantee microsoft recommended approach can been working me error-free on year in case.

if prefer way think be: if (f.invokerequired) ...

but i'm not sure why that's necessary


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -