I am working on an add-in to copy variable values from the active tab to the other card tabs using a button. I have run across an issue. Using IEdmEnumeratorVariable5.GetUpdateVars() or IEdmEnumeratorVariable7.GetVersionVars() was crashing Windows Explorer.
if (poCmd.mbsComment == "Copy Var Values")
EdmCmdData ecd = (EdmCmdData)ppoData.GetValue(0);
string activeconfigname = ecd.mbsStrData1;
IEdmFile5 file = edmVault.GetObject(EdmObjectType.EdmObject_File, ecd.mlObjectID1) as IEdmFile5;
IEdmEnumeratorVariable5 evar = (IEdmEnumeratorVariable5)poCmd.mpoExtra;
object valuelist = null;
evar.GetUpdateVars(ecd.mlObjectID2, out valuelist);
IEdmStrLst5 cfgs = (IEdmStrLst5)ecd.mpoExtra;
//UpdateVariables(ecd.mlObjectID2, activeconfigname, file, evar, cfgs);
When I added code to capture the error I received the following message.
It would appear that this only occurs when using either of these methods from a data card button. Has anyone else seen this and is there a workaround?
Card buttons return
your problem is MPOExtra is an IEDMStrLst5.
so according to the confusing note at the bottom, does this mean that MPOExtra is an array of 3 objects
one IEDMEnumeratorVariable5, One IEDMCard5, and One IEDMStrLst5?
regardless your evar is not casting to what you want.
you can get it from the file, try that.
Evar = File.GetEnumeratorVariable