Adding a menu item with createMenuItem

clcoop

New Member
I am trying to add a menu item to the Smart Toolbar using the createMenuItem dynamic function in the initializeObject procedure. Based on the following definition of the createMenuItem function,

createMenuItem (toolbar.p)
Creates a menu item with an ON CHOOSE trigger defined.
Parameters:
INPUT phParent AS HANDLE
Parent frame
INPUT pcName AS CHARACTER
Name of the item
INPUT pcCaption AS CHARACTER
Tooltip for the item
INPUT pcAccelerator AS CHARACTER
Action accelerator
INPUT plSensitive AS LOGICAL
Whether the item is sensitive
Returns: HANDLE
Notes: Creates a persistent trigger ON CHOOSE that runs onChoose( pcName ).

I am using the following code in a very basic window including a standard Smart Toolbar. I want to merely add the menu item "Test" to the File menu, but I am getting an error "Invalid character in numberic input (76)." I also get an error when the parent is set to "", which I understood was supposed to create a main menu item.

DYNAMIC-FUNCTION('createMenuItem':U IN h_dyntoolbar,
INPUT "File", /* Parent handle */
INPUT "Test", /* Name */
INPUT "Tooltip", /* Tooltip */
INPUT "Action", /* the action accelerator */
INPUT yes /* Yes if the item should be sensitive */
).

The only documentation I could find on this was in the Progress ADM2 Guide, which only defines the function createMenuItem. The Progress knowledge base 21816 "An easy way to add a new button in a Smart Toolbar" covers toolbar buttons only. I have not been able to find any examples of the createMenuItem function. Does anyone know where I can find some examples, or has anyone conquered this? Any help will be greatly appreciated.
 
Top