(VB.NET) ShowDialog from Outlook Commandbar causes crash in ntdll.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!!

Does anyone have the same problem?

I have created a simple commandbar in Outlook with VB.NET, and in it I have put a simple commandbarbutton. The bug appears when the button is used to show a dialog modally ie.

Private WithEvents myButton As Office.CommandBarButton

Private Sub myButton_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles myButton.Click
Dim frm As New Form1
frm.ShowDialog()
End Sub

The bug behaviour is such:
1. When the user clicks on myButton for the first time, the form shows normally.
2. When the user closes the form, it closes normally
3. When the user clicks on the same button for the second time, the form also shows normally
4. When the user now tries to close the form, Outlook crashes

Can anyone help me?
 
I have experienced similar problems too...
Unfortunately, I had to resort to using the Show() method
instead of ShowDialog() which would be more appropriate
for an About dialog box.

Also, I've experienced weird behavior with Windows Forms
in general. Sometimes it displays, sometimes it doesn't.

Special condition: Using Word as email editor, click
commandbar button to display a form, form doesn't
display. Use Outlook default editor, form displays.

I have tracked the problem to the InitializeComponent()
routine within the New() constructor of the form class
module. But, I'm baffled as to the cause...
-----Original Message-----
Hi!!

Does anyone have the same problem?

I have created a simple commandbar in Outlook with
VB.NET, and in it I have put a simple commandbarbutton.
The bug appears when the button is used to show a dialog
modally ie.
Private WithEvents myButton As Office.CommandBarButton

Private Sub myButton_Click(ByVal Ctrl As
Microsoft.Office.Core.CommandBarButton, ByRef
CancelDefault As Boolean) Handles myButton.Click
Dim frm As New Form1
frm.ShowDialog()
End Sub

The bug behaviour is such:
1. When the user clicks on myButton for the first time, the form shows normally.
2. When the user closes the form, it closes normally
3. When the user clicks on the same button for the
second time, the form also shows normally
 
Back
Top