This produces the same error as before, "Value does not fall within the expected range." string className = dataReader.GetString(0);
idx = counter;
CmdTest2 cmdTest3 = new CmdTest2(entitySetName + " - " + className, entitySetName, className);
UID uid = new UID();
uid.Value = "RegGSS.cmdTest3";
pMenu.Add(uid, ref idx);
counter++;
This produces a new error, "command not available." string className = dataReader.GetString(0);
idx = counter;
CmdTest2 cmdTest3 = new CmdTest2(entitySetName + " - " + className, entitySetName, className);
UID uid = new UID();
uid.Value = "{adc85ec2-c1c8-48ce-a975-1de2f0b393ff}";
pMenu.Add(uid, ref idx);
counter++;
I don't think my second attempt is correct at all because the uid number is for the original command, CmdTest2, not the new instance, cmdTest3.Since adding an existing ArcGIS command and prexisting user created command (CmdTest2) works, it is starting to sound to me like you cannot create a new instance of a command and immediately add it to a menu but that too doesn't sound right. I messed with IMultiItem a bit too but could not get it working for my needs.Thanks again for your time and effort!