Hi, everyone
I have coded a program 'stf2pkpm.ma'. When I load it by keyin 'mdl load stf2pkpm', it add a menu item 'PKPM Data File' at the bottom of 'File->Export'. But I want this task automatically execute. So, I configure 'Design Application' to 'stf2pkpm'. After I finished my configuration, when MicroStation start or open a new design file, 'stf2pkpm.ma' can be loaded automatically but my menu item not display. Why?
The following is my source code.
Private void addMenuToExport (void)
{
RawItemHdr *mainMenuBarP = NULL;
DItem_PulldownMenuItem newMenuItem;
DItem_PulldownMenu *exportMenuP = NULL;
TextPDM_Item textPDMInfo;
TextPDM_ItemModify textPDMModify;
mainMenuBarP = mdlDialog_menuBarGetCmdWinP ;
if (mainMenuBarP != NULL)
exportMenuP = mdlDialog_menuBarFindMenu (mainMenuBarP, RTYPE_PulldownMenu, PULLDOWNMENUID_SubExport); else return; if (exportMenuP == NULL) return; if (!mdlDialog_menuBarFindItem (&newMenuItem, NULL, mainMenuBarP, RTYPE_PulldownMenu, NULL, 196632L)) return; textPDMModify.submenu = FALSE; textPDMInfo.enabled = ON; textPDMModify.enabled = TRUE; textPDMInfo.mark = NOMARK; textPDMModify.mark = TRUE; textPDMInfo.helpInfo = NOHELP; textPDMModify.helpInfo = FALSE; textPDMModify.helpType = FALSE; textPDMModify.helpTaskIdP = FALSE; textPDMInfo.pulldownItemHookId = NOHOOK; textPDMModify.pulldownItemHookId = FALSE; textPDMInfo.pulldownSearchId = 196632L; textPDMModify.pulldownSearchId = TRUE; textPDMInfo.commandNumber = CMD_STF2PKPM_OPENMAINDLG; textPDMModify.commandNumber = TRUE; textPDMInfo.commandTaskIdP = malloc (10); strcpy (textPDMInfo.commandTaskIdP, "stf2pkpm"); textPDMModify.commandTaskIdP = TRUE; textPDMInfo.unparsedP = malloc (4); strcpy (textPDMInfo.unparsedP, ""); textPDMModify.unparsedP = TRUE; textPDMInfo.labelP = malloc (20); strcpy (textPDMInfo.labelP, "~PKPM Data File"); textPDMModify.labelP = TRUE; textPDMInfo.accelerator = NOACCEL; textPDMModify.acceleratorP = TRUE; textPDMInfo.mnemonic = 0; textPDMModify.mnemonic = FALSE; textPDMInfo.mneIndex = 0; textPDMModify.mneIndex = FALSE; mdlDialog_textPDMItemIns (&newMenuItem, exportMenuP, NULL, &textPDMInfo, &textPDMModify); }
Any help is greatly appreciated.
Foo.
I have coded a program 'stf2pkpm.ma'. When I load it by keyin 'mdl load stf2pkpm', it add a menu item 'PKPM Data File' at the bottom of 'File->Export'. But I want this task automatically execute. So, I configure 'Design Application' to 'stf2pkpm'. After I finished my configuration, when MicroStation start or open a new design file, 'stf2pkpm.ma' can be loaded automatically but my menu item not display. Why?
The following is my source code.
Private void addMenuToExport (void)
{
RawItemHdr *mainMenuBarP = NULL;
DItem_PulldownMenuItem newMenuItem;
DItem_PulldownMenu *exportMenuP = NULL;
TextPDM_Item textPDMInfo;
TextPDM_ItemModify textPDMModify;
mainMenuBarP = mdlDialog_menuBarGetCmdWinP ;
if (mainMenuBarP != NULL)
exportMenuP = mdlDialog_menuBarFindMenu (mainMenuBarP, RTYPE_PulldownMenu, PULLDOWNMENUID_SubExport); else return; if (exportMenuP == NULL) return; if (!mdlDialog_menuBarFindItem (&newMenuItem, NULL, mainMenuBarP, RTYPE_PulldownMenu, NULL, 196632L)) return; textPDMModify.submenu = FALSE; textPDMInfo.enabled = ON; textPDMModify.enabled = TRUE; textPDMInfo.mark = NOMARK; textPDMModify.mark = TRUE; textPDMInfo.helpInfo = NOHELP; textPDMModify.helpInfo = FALSE; textPDMModify.helpType = FALSE; textPDMModify.helpTaskIdP = FALSE; textPDMInfo.pulldownItemHookId = NOHOOK; textPDMModify.pulldownItemHookId = FALSE; textPDMInfo.pulldownSearchId = 196632L; textPDMModify.pulldownSearchId = TRUE; textPDMInfo.commandNumber = CMD_STF2PKPM_OPENMAINDLG; textPDMModify.commandNumber = TRUE; textPDMInfo.commandTaskIdP = malloc (10); strcpy (textPDMInfo.commandTaskIdP, "stf2pkpm"); textPDMModify.commandTaskIdP = TRUE; textPDMInfo.unparsedP = malloc (4); strcpy (textPDMInfo.unparsedP, ""); textPDMModify.unparsedP = TRUE; textPDMInfo.labelP = malloc (20); strcpy (textPDMInfo.labelP, "~PKPM Data File"); textPDMModify.labelP = TRUE; textPDMInfo.accelerator = NOACCEL; textPDMModify.acceleratorP = TRUE; textPDMInfo.mnemonic = 0; textPDMModify.mnemonic = FALSE; textPDMInfo.mneIndex = 0; textPDMModify.mneIndex = FALSE; mdlDialog_textPDMItemIns (&newMenuItem, exportMenuP, NULL, &textPDMInfo, &textPDMModify); }
Any help is greatly appreciated.
Foo.