NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Report Options - Sequence Call in New Thread

Solved!
Go to solution

Hello there,

 

I'm upgrading from TestStand 4.1 to 2010 and ran into the following situation while trying to make changes to the Report Options call:

 

1. I have a custom process model (TS4.1) for which I had eliminated the need for the OTB ModelSupport.seq file and had moved all its functionality into our process model. For the Configure Report Options configuration entry point I have a direct call to the DisplayReportOptionsDialogEx function in the modelsupport2.dll instead of a call to the Configure Report Options (ModelSupport.seq) sequence which then calls modelsupport2.dll. (See step below)

 

reportoptions.jpg

 

 

2. When I upgraded to TS2010 I found out that the Configure >Report Options... menu item wasn't running properly, i.e. I couldn't see the Report Options dialog. After debugging I realized that the dialog is only shown (or at least that was the only way I could make it work) when it is called within a sequence run in a new thread with the settings shown below

 

singlethread.jpg

 

Is there anyway that I can call DisplayReportOptionsDialogEx (modelsupport2.dll) without the need for an extra sequence running in a separate thread? I'd like to keep the Process Model as simple and small as possibe and minimize the number of sequences.

 

Was there a change in TestStand regarding the way the Configuration Entry points run? ( If I were to make changes to modelsupport2.dll is there anything that I should be aware of?...)

 

Thanks for your help!

 

<<-N->>

0 Kudos
Message 1 of 4
(3,982 Views)

For some reason the first attachment didn't make it... but it works when I attach a picture on this post. oh well, you get the idea

 

reportoptions.jpg

0 Kudos
Message 2 of 4
(3,976 Views)
Solution
Accepted by topic author icastillejos

The reason the sequence call exists is to launch the dialog in an STA thread. In 4.2, the report options dialog got a new feature, the ability to specify report paths by expression. This required adding the ActiveX expression control to the dialog. Dialogs with ActiveX controls must be in STA threads.

 

You could create the STA thread yourself in a DLL and call the dialog from there, but just using the sequence call is simpler.

Message 3 of 4
(3,951 Views)

Awesome, that's good to know

 

Thanks for your help!

 

<<-N->>

0 Kudos
Message 4 of 4
(3,921 Views)