CATDlgContextualMenu *pCntxMenu = new CATDlgContextualMenu("需要添加右键菜单的控件指针", "menu");
if (NULL != pCntxMenu)
{
//菜单条目对应的名称
CATString StartString("StartPoint");
CATString MediumString("MediumPoint");
CATString EndString("EndPoint");
//定义
CATDlgSeparatorItem *Separator = new CATDlgSeparatorItem(pCntxMenu, "separator");
CATDlgPushItem * StartPoint = new CATDlgPushItem(pCntxMenu, StartString);
CATDlgPushItem * MediumPoint = new CATDlgPushItem(pCntxMenu, MediumString);
CATDlgPushItem * EndPoint = new CATDlgPushItem(pCntxMenu, EndString);
//菜单项点击对应的响应 Menu为处理响应的函数 (void*)为传入的参数
AddAnalyseNotificationCB(StartPoint,
StartPoint->GetMenuIActivateNotification(),
(CATCommandMethod)&CAAECreateNewFeatureCmd::Menu, (void*)1);
AddAnalyseNotificationCB(MediumPoint,
MediumPoint->GetMenuIActivateNotification(),
(CATCommandMethod)&CAAECreateNewFeatureCmd::Menu, (void*)2);
AddAnalyseNotificationCB(EndPoint,
EndPoint->GetMenuIActivateNotification(),
(CATCommandMethod)&CAAECreateNewFeatureCmd::Menu, (void*)3);
}