I'm using the ActiveX Control of MapPoint 2004 in a .NET 2.0 Windows Forms Application. I've put the ActiveX Control on a UserControl which works pretty good. The only problem is when I close the UserControl I sometimes get an RaceOnRCWCleanup error. I think the error only occurs when use the mnemonic assigned with the close button, but I'm not 100% sure of that.
The following code is used for closing the UserControl:
privatevoid btClose_Click(object sender, EventArgs e)
if (axMapPoint.ActiveMap != null)
axMapPoint.ActiveMap.Saved = true;
//Removes the active UserControl from the form & calls Dispose() on it.
Program.MainForm.CurrentUserControl = newMainMenuCtrl();
Any help would be appreciated.