Solution - ArcFM - While debugging an autoupdater that throws the MM_E_CANCELEDIT exception, the edit is not canceled

Version 3

    Behavior

    Using Visual Studio 2010, having the debugger attached to ArcMap and having an autoupdater throw the MM_E_CANCELEDIT exception does not properly cancel the edit.  Instead, Visual Studio catches the exception as an unhandled exception and the edit is not canceled.  While not debugging in Visual Studio, the MM_E_CANCELEDIT exception works correctly.

     

    Cause

    Visual Studio 2010's exception handling incorrectly identifies a thrown MM_E_CANCELEDIT exception as an unhandled exception.  It then catches the exception itself.

     

    Solution

    This issue does not happen with versions of Visual Studio past 2010.  We have verified that using Visual Studio 2013, you will not see this issue.  We recommend using Visual Studio 2013 for customization developing on versions of ArcFM past 10.2.1a.

     

    If you need to debug this type of autoupdater at Visual Studio 2010, you can prevent the problem by clicking Debug > Exceptions, expand the Language Common Runtime exceptions, and uncheck the User-unhandled checkbox for System.Runtime.InteropServices.COMException.

    excpetion.PNG