LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving and Binding Submenu Commands from a Specific Menu in LabWindows/CVI (TestStand UI API)

 

I am using LabWindows/CVI with the TestStand UI API to connect commands to a TestStand UI button control.

I successfully retrieved the "Maintenance" menu using the following command:

 

tsErrChk(TSUI_ApplicationMgrConnectCommand(gMainWindow.applicationMgr, &errorInfo, gMainWindow.subBtnHandle, TSUIConst_CommandKind_Tools_Set, 6, TSUIConst_CommandConnection_IgnoreVisible, NULL));
However, I am only able to retrieve the "Maintenance" itself, but not the items inside it.

I need to retrieve and connect the following submenu items like :

  • Measurement and Automation Explorer... (Sequence) → gMainWindow.subBtnHandle
  • Autocont (Sequence) → gMainWindow.subBtn1Handle
  • Autotest MatricegMainWindow.subBtn2Handle

And so on.

I have attached a screenshot of the submenu I want to retrieve.

How can I dynamically list and bind these specific submenu commands to the correct handles?

0 Kudos
Message 1 of 3
(155 Views)

I try this code, i get names of submenu but i can't connect command to Teststand ui button...

 

TSUI_SequenceFileViewMgrGetCommand(gMainWindow.sequenceFileViewMgr, &errorInfo,TSUIConst_CommandKind_Tools_Set, 6, &command);
TSUI_CommandGetSubsidiaryCommands(command, &errorInfo, &commands);
TSUI_CommandsGetCount(commands, &errorInfo, &num);
for (int j = 0 ; j < num ; j++)
{
TSUI_CommandsGetItem(commands, &errorInfo, j, &customCommand);
// This display name of submenu
//TSUI_CommandGetDisplayName(customCommand,&errorInfo, "&", VTRUE, &displayName);

TSUI_CommandsInsertKind(customCommand, &errorInfo, TSUIConst_CommandKind_ExecutionEntryPointDefaultMenuInsertionMarker, gMainWindow.sequenceFileViewMgr,
-1 , "", "", NULL);
// Never work !!            

tsErrChk(TSUI_SequenceFileViewMgrConnectCommand(gMainWindow.sequenceFileViewMgr, &errorInfo, gMainWindow.subBtnHandle, 
TSUIConst_CommandKind_ExecutionEntryPointDefaultMenuInsertionMarker, 0, TSUIConst_CommandConnection_IgnoreVisible, NULL));
}

 

Please help.

0 Kudos
Message 2 of 3
(78 Views)

Any help please ?

0 Kudos
Message 3 of 3
(5 Views)