I'm trying to create a new menu in GP2013 using Menus For Visual Studio Tools. The menu code in the GP addin fires properly and it creates the menu tags, however the menu tags for the parent Human Resources Transactions menu is coming back as a negative value. This code works for previous versions of GP (2010 and GP10), but now it doesn't work.
How do i resolve this issue?
The code for the menu creation is below, any advice would be very much appreciated.
public class GPAddIn : IDexterityAddIn
{
// IDexterityAddIn interface
short HRTrxMenuTag;
short TimeCodeMenuTag;
short MassTimeCodeMenuId;
public void Initialize()
{
MenusForVisualStudioTools.Functions.EventRegister.InvokeAfterOriginal += new Microsoft.Dexterity.Applications.MenusForVisualStudioToolsDictionary.EventRegisterFunction.InvokeEventHandler(EventRegister_InvokeAfterOriginal);
MenusForVisualStudioTools.Functions.EventHandler.InvokeAfterOriginal += new Microsoft.Dexterity.Applications.MenusForVisualStudioToolsDictionary.EventHandlerFunction.InvokeEventHandler(EventHandler_InvokeAfterOriginal);
}
void EventHandler_InvokeAfterOriginal(object sender, Microsoft.Dexterity.Applications.MenusForVisualStudioToolsDictionary.EventHandlerFunction.InvokeEventArgs e)
{
if (e.inParam1 == TimeCodeMenuTag)
{
Microsoft.Dexterity.Applications.CogsdaleCsm.Forms.UmUprTimeCodeTransfer.Open();
}
if (e.inParam1 == MassTimeCodeMenuId)
{
Microsoft.Dexterity.Applications.CogsdaleCsm.Forms.UmUprTimeCodeMassTransfer.Open();
}
//throw new NotImplementedException();
}
void EventRegister_InvokeAfterOriginal(object sender, Microsoft.Dexterity.Applications.MenusForVisualStudioToolsDictionary.EventRegisterFunction.InvokeEventArgs e)
{
//throw new NotImplementedException();
HRTrxMenuTag = MenusForVisualStudioTools.Functions.GetTagByName.Invoke(0, "CL_HumanResources_Transactions", "Command_System");
if (HRTrxMenuTag != 0)
{
TimeCodeMenuTag = MenusForVisualStudioTools.Functions.Register.Invoke(HRTrxMenuTag, "Time Code Transfer", "Time Code Transfer", 0, 0, false, false, false, HRTrxMenuTag, false, false);
MassTimeCodeMenuId = MenusForVisualStudioTools.Functions.Register.Invoke(HRTrxMenuTag, "Time Code Mass Transfer", "Time Code Mass Transfer", 0, 0, false, false, false, HRTrxMenuTag, false, false);
}
}
}
*This post is locked for comments