在我的 Outlook 2013 VSTO 插件中,我有以下代码:
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
Task.Run(Sub() DoStuff())
End Sub
Private Sub DoStuff()
' Do some long task stuff
Call StuffDone()
End Sub
Private Sub StuffDone()
If ????.InvokeRequired Then
????.Invoke(New MethodInvoker(AddressOf StuffDone))
Exit Sub
End If
Dim f As New Form1
f.Show()
End Sub
但我不知道如何调用 InvokeRequired 因为没有主窗体??
谢谢