I've created a custom form that has a couple buttons and a Text box.
This custom form is opened by a click event button I have created on a Microsoft outlook add-in that I am working on attached to a 'Ribbon'. (Not sure if this matters, no problem here).
On the windows form, The first button simply saves the contents of the text file to disk.
The other button attempts to close the form. In this buttons click event I have tried the following two lines, separate and together
this.Close(); and this.Dispose();
When I use this button or the Form exit (the 'x' located in the upper right of a windows form) I receive the follow error,
COMException was unhandled by user Exception from HRESULT: 0x800A01A8
When this error is thrown, it takes me to the 'Connect.cs' files following method,
public void OnBeginShutdown(ref System.Array custom)
{
this.toolbarButton.Delete(System.Reflection.Missing.Value);
this.toolbarButton = null;
}
I'm not sure how to begin troubleshooting this. I have done a fair amount of research but unfortunately haven't found much. I'm sure the problem might be the fact I have created a custom form with no experience and there are some 'housekeeping' or 'best practices' that I have not done or are aware of.
Anyone have insight into this?