Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

New Post: Sharpdevelop Debugging Event Handler problem

$
0
0
Hi all, This is really more to do with Sharpdevelop, I've posted my question there but most posts doesn't seem to get much response there so I thought I'd try here.
I'm trying to inspect variables while debugging, in Visual Studio all works fine. In SD all works fine except when debugging within a NetOffice event handler. In the below code if I break within myOlItems_ItemAdd sub, I can't inspect any vars and everything freezes in outlook and the app. I'm sure this has something to do with threads but if anyone can confirm this and why and if there is a workaround I'd appreciate it.
Imports Outlook = NetOffice.OutlookApi

Imports NetOffice.OutlookApi.Enums

Public Partial Class MainForm

Public Sub New()

   Me.InitializeComponent()

End Sub

Sub Button1Click(sender As Object, e As EventArgs)

  Dim outlookApplication As New Outlook.Application()

  Dim objNS As Outlook._NameSpace = outlookApplication.GetNamespace("MAPI")

  Dim inboxFolder As Outlook.MAPIFolder = objNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox)

  Dim olInboxItems As Outlook.Items = CType(inboxFolder.Items, Outlook.Items)

  Dim ItemAdded As Outlook.Items_ItemAddEventHandler = AddressOf Me.myOlItems_ItemAdd

      AddHandler olInboxItems.ItemAddEvent, ItemAdded

End Sub

Private Sub myOlItems_ItemAdd(ByVal Item As Object)

Debugger.break

MessageBox.Show("Made it here")

End Sub

End Class

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>