G'Day from WA,
I attempting to update a MDL program to append a custom menu to the Command Window Menu Bar. The code I use is shown below (formatting is lost when I pasted text into this message)
RawItemHdr *mbarP = NULL;
DItem_PulldownMenu *mbarMenuP = NULL;
mbarP = mdlDialog_menuBarGetCmdWinP();
if ( mbarP == NULL )
{
mdlDialog_dmsgsPrint ( "Error: Could not find main menu bar" );
}
else
{
if ( mdlDialog_menuBarFindMenu ( mbarP, RTYPE_PulldownMenu, 1001 ) == NULL )
{
if ( mdlDialog_menuBarInsMenu ( mbarP, RTYPE_PulldownMenu, 1001, NULL ) != NULL )
{
mbarMenuP = mdlDialog_menuBarFindMenu ( mbarP, RTYPE_PulldownMenu, 1001 );
mdlDialog_menuBarMenuSetTitle ( mbarMenuP, "New Menu" );
}
else
mdlDialog_dmsgsPrint ( "Failed to insert menu ...\n" );
}
}
When the function mdlDialog_menuBarInsMenu () is called the error message below is displayed in the Message Center dialog
Unable to load/create dialog item of type 'PDTextMenu', id = 1001 from dialog "s06011201.dgn [2D - V8 DGN] - MicroStation V8i (S"
I have successfully used this code with previous versions of Microstation.
Version information
Microstation V8i (SELECT series2) - Version 08.11.07.453
Windows XP 5.1 SP3
Regards
Steve