02-16-2025 11:35 AM - edited 02-16-2025 11:39 AM
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));
I need to retrieve and connect the following submenu items like :
gMainWindow.subBtnHandle
gMainWindow.subBtn1Handle
gMainWindow.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?
02-17-2025 07:42 AM - edited 02-17-2025 08:21 AM
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.
02-21-2025 04:23 AM
Any help please ?