A Borland C++ Builder 4 operator interface can import the NI TestStand Engine ActiveX interface and reach callbacks, dialogs, sequence steps, and execution entry points, yet fail when starting a sequence. The observed failure occurs at TEngine::NewExecution with error -17500, identified in the available API guide as TS_Err_OperationFailed.
Confirmed Failure Boundary
The integration works through sequence inspection but fails specifically when NewExecution is called. Borland C++ Builder 4 is the confirmed working import environment; attempts with Borland C++ Builder 6 had separate unresolved problems.
| Item | Evidence | Engineering conclusion |
|---|---|---|
| ActiveX import | Successful in Borland C++ Builder 4 | The failure occurs after basic Engine access is established. |
| Sequence access | Steps and execution entry points can be enumerated | A sequence is accessible before execution starts. |
| Failure point | NewExecution |
Investigate call arguments and wrapper behavior. |
| Reported error |
-17500 / TS_Err_OperationFailed
|
The code alone does not identify which argument failed. |
Use the Imported Full Signature
The generated TS_OCX.cpp wrapper exposes all arguments, although the final three Variant arguments are marked optional in the API documentation. The compiler does not resolve a shorter overload, so call the generated full signature rather than assuming that C++ optional-argument syntax is available.
ExecutionPtr __fastcall TEngine::NewExecution(
Ts_tlb::SequenceFile* sequenceFileParam,
BSTR sequenceName,
Ts_tlb::SequenceFile* processModelParam,
VARIANT_BOOL breakAtFirstStep,
long executionTypeMaskParam,
VARIANT sequenceArgsParam,
VARIANT editArgsParam,
VARIANT InteractiveArgsParam);
The attempted omission mechanism uses TNoParam(), which returns a Variant whose vt is VT_ERROR, matching the omission representation used by CA_DEFAULT_VAL in the referenced CVI example. The evidence does not establish that this representation is accepted unchanged by the Borland-generated wrapper.
Isolate the Argument or Wrapper Failure
- Confirm at the failing call that the sequence-file pointer, sequence name, process-model pointer, break flag, and execution-type mask are the intended values. The generic error does not distinguish among them.
- Inspect each of the final three Variants immediately before invocation and verify that its
vtremainsVT_ERRORafter construction and parameter passing. - Compare the generated Borland declaration and implementation of
NewExecutionwith the imported ActiveX type information. Treat any mismatch in argument order or Variant marshaling as a wrapper hypothesis, not a confirmed TestStand Engine defect. - Reproduce the call with the smallest sequence already proven accessible through the Engine. Success isolates the problem to the original execution inputs; continued
-17500keeps the wrapper or omitted-argument marshaling under investigation.
Version Decision
TestStand 3.0 was suggested for evaluation, but the evidence does not confirm the installed TestStand version, an affected-version range, or that upgrading resolves -17500. Record the exact TestStand version and compare the generated wrapper against that version before treating a version change as the fix.
FAQ
What does TestStand error -17500 mean?
The available API guide identifies -17500 as TS_Err_OperationFailed. It is a generic failure and does not identify the invalid NewExecution argument.
Why can’t Borland C++ Builder call the short NewExecution form?
The imported wrapper exposes a full signature and the compiler cannot find a shorter overload. Supply all arguments, including the three trailing Variant parameters.
Does VT_ERROR fix optional NewExecution arguments?
TNoParam() produces a Variant with vt = VT_ERROR, but the recorded call still returns -17500. Verify the Variant at the call boundary and the generated wrapper’s marshaling before accepting it as a valid omission mechanism.