I'm still very green on the use of the TestStand Engine API, but I'm starting to think I am missing some crucial understanding of how this is all tied together and the flow of events and processes and threads.
Anyway, I have the Full-Featured Visual C++ code that I have been modifying. From an external stimulus (NOT the user interface) I am told to run a sequenceusing the sequential model (Single Pass). I call or perform the following:
Engine->FindFile to verify the sequence exists before continuing.
Engine->GetSequenceFileEx to obtain a SequenceFilePtr
Engine->GetStationModelSequenceFile to obtain a SequenceFilePtr for the station model sequence
Create a _variant_t sequence arguments object from a sequence arguments property object passed in
Finally call Engine->NewExecution for the sequence
Engine->ReleaseSequenceFileEx for both the sequence and station model sequence ptrs
The sequence executes, but gets to a point where it sends a UI message and then waits on a notification.
The UI message is handled by the OI, which eventually results in another external stimulus to run a "wakeup" sequence which will send a notification to allow the first sequence to continue. This second sequence executes the same path of code as described above, except it doesn't get the station model sequence. When the NewExecution is called for this "wakeup" sequence, then I get the OI crashing with a runtime error. If I capture the exception, it's a -17332 (TS_Err_ObjectTypeIncompatibleWithParameter). I can not find any other help (in TestStand or on the web) about the cause of this type of error. I have verified all the parameters are valid, but my guess is that something about having multiple new executions going simultaneously is giving the engine fits sometimes.
Note that I do not always get this error, but generally most of the time. I am sure I am violating some set of "rules" about how to call these functions, with the wrong parameters in the wrong order, but it's hard to determine what is right always. The HELP is excellent, but like most things, you have to know what you are looking for before you can find it.
Thanks for any thoughts from the community.
Attached is the a file with the method that executes the above functions if it's of any interest.