Anyone seeing PInvokeStackImbalance errors reported when debugging CommandBars.Add arcobjects v10.4 code

05-16-2016 02:09 PM
New Contributor II

The following code works fine in AGD 10.3.1, but managed debug assistant throws a PInvokeStackImbalance error in AGD 10.4 (ESRI.ArcGIS.ADF.Local!ESRI.ArcGIS.ADF.Native::memcpy). Any fix other than ignoring this kind of exception?

private void LoadCustomizations()




             ICommandBar pContextMenu = GetCommandBar("{7D931EAE-D31F-11D2-9F40-00C04F6BC78E}");

                if (pContextMenu ==  null)




                UID pUIDSubmit = new UID();

                pUIDSubmit.Value = "SubmitVersion.cmdSubmitVersion";

                Object indexObj = Type.Missing;

                ICommandBar subVercmd = pContextMenu.Add(pUIDSubmit, ref indexObj) as ICommandBar;


                m_isMenuPresent = true;


0 Kudos
1 Reply
Esri Contributor

Check out this Technical Article ( I believe the problem discussed in Article 000012655 also occurs in 10.3.x version. Based on the Article, I don't think there are other ways to fix it other than unchecking the exception settings, since it appears to be a framework-level issue and there is nothing in the code that we can modify.