I want to create an object in teststand for my C# form dll which has an ActiveX Control . but the error says ActiveX control can not be instantiated because the current thread is not in a single-threaded apartment. can someone help to solve the problem?
1) put the step in a subsequence and use the sequence call "New thread" option with the advanced setting "Use single-threaded Apartment". Put a wait step immediately after the sequence call to wait for the new thread.
2) Inside of your dll, using .NET APIs create a new thread initialized as STA and call your code from that. Have the original thread wait for the new thread to finish running your dialog code.
Hope this helps,
Thanks for your help.
For the option(1),
i use the Action not the sequence call, so how can i do that?
You could create a new subsequence in your file, place the Action step in that sequence, and then call it from your main sequence with the Sequence Call step as Doug described. This allows you to use the STA option.