After several questions and answers in your forum I finally imported successfully the TestStand Engine ActiveX in my loved Borland C++ Builder, but I couldn�t use the version 6, I used an older version (BCB4). It works fine.
Here you can find the questions I posted about some problems I had with BCB6
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000000EA20000&UCATEGORY_0=_8_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=borland+teststand&USEARCHCONTEXT_QUESTION_S=0)
To start developing an O.I. in BCB4 I'm using the Dephi Operator interface example code as a guide line and a simple example code for CVI to understand witch are the basic steps to run a sequence.
Everything seems ok, for example I can easily access the Login/Logout callback, or display TS dialog boxes (Station Options...ecc.), or iterate through sequence steps to extract execution entry points.
Next target is run a simple sequence, but something fails when I call the NewExecution method.
The prototype in the TS_OCX.cpp file should be:
ExecutionPtr __fastcall TEngine::NewExecution(Ts_tlb::SequenceFile* sequenceFileParam/*[in]*/,
BSTR sequenceName/*[in]*/,
Ts_tlb::SequenceFile* processModelParam/*[in]*/,
VARIANT_BOOL breakAtFirstStep/*[in]*/,
long executionTypeMaskParam/*[in]*/,
VARIANT sequenceArgsParam/*[in,opt]*/,
VARIANT editArgsParam/*[in,opt]*/,
VARIANT InteractiveArgsParam/*[in,opt]*/)
First of all, I cannot use the short version of NewExecution method, even if in the API user guide and in the func.prototype "sequenceArgsParam", "editArgsParam" and "InteractiveArgsParam" are marked as optional, that�s because the compiler cannot find the right prototype.
In this case "sequenceArgsParam", "editArgsParam" and "InteractiveArgsParam" are all Variant type, so I'm trying to pass an empty parameter to them, that's just to use all parameters in the function call.
I tried all solutions I know, but I think that TNoParam() is the simplest I can use. TNoParam() class returns a Variant type witch sets vt member = VT_ERROR, just like in CVI example (CA_DEFAULT_VAL).
No way out.
I get a run-time error message when I call The NewExecution method (Error:-17500) = TS_Err_OperationFailed in API user guide.
Solving this problem is really important for me, because it�s the last thing (I hope..) I need to do to complete a simple Borland C++ Builder TestStand operator interface example.
Thanks and best regards.
Alex Bassi