AnsweredAssumed Answered

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

Question asked by gwalt_blm on May 16, 2016
Latest reply on Jun 3, 2016 by HSun-esristaff

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;