As an example of what I am trying to do, I would like to disable the "Open Sequence File" command button and menu in my TestStand OI if a sequence file is already open.
So in my SequenceFileChanged event callback VI, I get the command from the SequenceFileViewManager (using the GetCommand() function with CommandKind input of "CommandKind_OpenSequenceFile") and then set the Command.Enabled to either True or False. But setting the property doesn't seem to have any effect on the UI control or menu item to which the command is connected. (I have also tried the Command.Visible property without any effect.)
I can read the property immediately before and after I set it, and the value I read confirms that the value changes when it supposed to; but the value seems to revert once the callback VI finishes, because the next time the VI is called, the value I read is not always the value that I read in the previous call. It's like the Command object loses scope when the VI exits and never gets written to the Manger control.
During the initialization of my program, when I connect my UI button to the command using SequenceFileViewMgr.ConnectCommand(), I have tried using a value of CommandConnection_IgnoreEnable (0x4) for the CommandConnectionOptions input to the function, but that doesn't seem to help either.
Am I going down the right path to programmatically enable/disable command buttons, or am I completely off base here?
Jeff