02-08-2016 11:09 AM
Solved! Go to Solution.
02-08-2016 04:42 PM
I'm convinced that the only way to access that is through the UI Message called out in the help.
However, you can create your own OutputMessages object and use it:
Locals.OutputMessages = RunState.Engine.NewOutputMessages()
Then use:
Locals.OutputMessages.AsOutputMessages.Add(RunState.Engine.NewOutputMessage("Hi There", "Hello", OutputMessageSeverity_Information, Nothing))
Then to read it us:
Locals.OutputMessages.AsOutputMessages.Item(0).Message
The only downside to all of this is that it doesn't post, so no UI Message this way. However, you still get all the functionality of the OutputMessages.
Hope this helps,
02-10-2016 10:17 AM
Thanks jiggawax! I see what you're proposing, I think can make use of that technique less the posting part for what I'm trying to accomplish.
02-12-2016 04:07 PM
Note that when TestStand obsoletes API, that API is still functional. The new API supports the notion of having multiple clients, such as the Sequence Editor control, and other customer created components, which might be your use case.
02-12-2016 08:09 PM
Scott,
How do you make your own created collection of output messages post a UI Message? The only post API functions I see are for the ones in the collection owned by TestStand.
02-13-2016 09:00 PM
You can call engine.NewOutputMessages to create an empty collection for your UI component to manage. There is code in the help for the OutputMessages collection that illustrates how you might use it. If you want to maintain the collection outside of the scope of the callback then you would create the collection on init and store as a member of your control or form. Does that answer your question?
// C# example
if (uiMsg.Event == UIMessageCodes.UIMsg_OutputMessages)
{
OutputMessages outputMessages = uiMsg.ActiveXData as OutputMessages;
OutputMessages appOutputMessages = engine.NewOutputMessages();
outputMessages.CopyMessagesToCollection(appOutputMessages);
for(i = 0; i < appOutputMessages.Count; i++)
{
uiControl.Add(appOutputMessages[i].Message);
}
}